Your IP : 216.73.216.124


Current Path : /var/www/html/chatbot/backend/models/
Upload File :
Current File : /var/www/html/chatbot/backend/models/MessageGroupMember.php

<?php

namespace backend\models;

use backend\models\Staff;
use backend\models\MessageGroup;
use common\models\Dermaga;
use Yii;

/**
 * This is the model class for table "user_group_member".
 *
 * @property integer $user_group_id
 * @property integer $staff_info_id
 * @property string $created_by
 * @property string $createdAt
 * @property string $updated_by
 * @property string $updatedAt
 * @property string $staff_name
 * @property string $location
 * @property string $job_title
 * @property string $job_id
 */
class MessageGroupMember extends Dermaga{

    public $staff_name;
    public $location;
    public $job_title;
    public $job_id;
    
    public static function tableName() {
        return 'dmg_message_group_member';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['message_group_id','staff_info_id'], 'required'],
            [['message_group_id','staff_info_id'], 'required', 'on' => 'staff'], 
            [['message_group_id'],'integer'],
            [['staff_info_id','created_at', 'updated_at'], 'safe'],
            [['created_by', 'updated_by'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'message_group_id' =>  yii::t('app','User Group ID'),
            'staff_info_id' =>  yii::t('app','Employee Name'),
            'staff_name' =>  yii::t('app','Name'),
            'location' =>  yii::t('app','Location'),
            'job_title' =>  yii::t('app','Position'),
            'created_by' =>  yii::t('app','Created By'),
            'created_at' =>  yii::t('app','Created At'),
            'updated_by' =>  yii::t('app','Updated By'),
            'updated_at' =>  yii::t('app','Updated Date'),
        ];
    }

    public function getGroupMsg() {
        return $this->hasOne(MessageGroup::className(), ['id' => 'message_group_id']);
    }
    
    public function getStaff() {
        return $this->hasOne(Staff::className(), ['id' => 'staff_info_id']);
    }
    
     public function getCreated() {
        return $this->hasOne(Staff::className(), ['id' => 'created_by']);
    }

}