| Current Path : /var/www/html/delima/common/models/ |
| Current File : /var/www/html/delima/common/models/StaffAccess.php |
<?php
namespace common\models;
use backend\models\Staff;
/**
* This is the model class for table "ost_staff_access".
*
* @property integer $id
* @property string $role_code
* @property integer $staff_info_id
*/
class StaffAccess extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'dmg_staff_access';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['staff_info_id'], 'integer'],
[['role_code'], 'string', 'max' => 25],
];
}
public function getStaff(){
return $this->hasOne(Staff::className(), ['id' => 'staff_info_id']);
}
public function getStaffRole(){
return $this->hasMany(Role::className(), ['role_code' => 'role_code']);
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'role_code' => 'Role',
'staff_info_id' => 'Staff Info ID',
];
}
}