Your IP : 216.73.216.79


Current Path : /var/www/html/dvs/frontend/models/chat/
Upload File :
Current File : /var/www/html/dvs/frontend/models/chat/ChatUser.php

<?php

namespace frontend\models\chat;

use Yii;

/**
 * This is the model class for table "chat_user".
 *
 * @property int $user_id
 * @property int $user_live_active
 * @property string $user_name
 * @property string $user_phone
 * @property string $user_email
 * @property string $live_message_last
 * @property string $create_dttm
 *
 * @property ChatAnswer[] $chatAnswers
 * @property ChatQuestion[] $chatQuestions
 */
class ChatUser extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'chat_user';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['user_name', 'user_phone'], 'required'],
            [['live_message_last'], 'string'],
            [['create_dttm'], 'safe'],
            [['user_name'], 'string', 'max' => 1024],
            [['user_phone'], 'string', 'max' => 20],
            [['user_email'], 'string', 'max' => 100],
            [['user_live_active'], 'integer']
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'user_id' => Yii::t('app', 'User ID'),
            'user_name' => Yii::t('app', 'User Name'),
            'user_phone' => Yii::t('app', 'User Phone'),
            'user_email' => Yii::t('app', 'User Email'),
            'live_message_last' => Yii::t('app', 'Live Message Last'),
            'create_dttm' => Yii::t('app', 'Create Dttm'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getChatAnswers()
    {
        return $this->hasMany(ChatAnswer::className(), ['user_id' => 'user_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getChatQuestions()
    {
        return $this->hasMany(ChatQuestion::className(), ['user_id' => 'user_id']);
    }
}