Your IP : 216.73.216.79


Current Path : /var/www/html/drsa/backend/modules/chat/models/
Upload File :
Current File : /var/www/html/drsa/backend/modules/chat/models/ChatQuestion.php

<?php

namespace backend\modules\chat\models;

use Yii;

/**
 * This is the model class for table "chat_question".
 *
 * @property int $question_id
 * @property string $question_description
 * @property int $question_review
 * @property string $question_language
 * @property int $user_id
 * @property string $create_dttm
 *
 * @property ChatUser $user
 */
class ChatQuestion extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'chat_question';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['question_description'], 'required'],
            [['question_description', 'question_language'], 'string'],
            [['question_review', 'user_id'], 'integer'],
            [['create_dttm'], 'safe'],
            [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => ChatUser::className(), 'targetAttribute' => ['user_id' => 'user_id']],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'question_id' => Yii::t('app', 'Question ID'),
            'question_description' => Yii::t('app', 'Question'),
            'question_review' => Yii::t('app', 'Review Status'),
            'question_language' => Yii::t('app', 'Language'),
            'user_id' => Yii::t('app', 'User Name'),
            'create_dttm' => Yii::t('app', 'Date & Time'),
        ];
    }

    /**
     * Gets query for [[User]].
     *
     * @return \yii\db\ActiveQuery
     */
    public function getUser()
    {
        return $this->hasOne(ChatUser::className(), ['user_id' => 'user_id']);
    }
}