<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * @property integer $questionnaire_table_answer_id
 * @property integer $questionnaire_answer_id
 * @property integer $questionnaire_table_id
 * @property integer $created_by
 * @property string $table_answerhtml
 * @property string $created
 * @property string $modified
 * @property integer $status
 * @property User $user
 * @property QuestionnaireAnswer $questionnaireAnswer
 * @property QuestionnaireTable $questionnaireTable
 */
class QuestionnaireTableAnswer extends Model
{
    /**
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'questionnaire_table_answer';

    /**
     * The primary key for the model.
     * 
     * @var string
     */
    protected $primaryKey = 'questionnaire_table_answer_id';

    /**
     * The "type" of the auto-incrementing ID.
     * 
     * @var string
     */
    protected $keyType = 'integer';

    public $timestamps = false;

    /**
     * @var array
     */
    protected $fillable = ['questionnaire_answer_id', 'questionnaire_table_id',
     'created_by', 'table_answerhtml', 'created', 'modified', 'status'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo('App\Models\User', 'created_by', 'user_id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function questionnaireAnswer()
    {
        return $this->belongsTo('App\Models\QuestionnaireAnswer', 'questionnaire_answer_id',
         'questionnaire_answer_id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function questionnaireTable()
    {
        return $this->belongsTo('App\Models\QuestionnaireTable', 'questionnaire_table_id',
         'questionnaire_table_id');
    }
}
