| Current Path : /var/www/html/mygdx/common/models/ |
| Current File : /var/www/html/mygdx/common/models/Role.php |
<?php
namespace common\models;
use common\models\Dermaga;
/**
* This is the model class for table "ost_role_mapping".
*
* @property string $role_code
* @property integer $menu_id
*/
class Role extends Dermaga {
/**
* @inheritdoc
*/
public static function tableName() {
return 'dmg_role_mapping';
}
/**
* @inheritdoc
*/
public function rules() {
return [
[['role_code'], 'required'],
[['created_at', 'updated_at', 'deleted_at'], 'safe'],
[['role_code'], 'string', 'max' => 25],
[['created_by', 'updated_by'], 'string', 'max' => 50],
];
}
/**
* @inheritdoc
*/
public function attributeLabels() {
return [
'role_code' => 'Role',
'menu_id' => 'Menu',
];
}
public function getMenu() {
return $this->hasOne(Menu::className(), ['id' => 'menu_id']);
}
}