55 lines
1.1 KiB
PHP
55 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace common\modelsgii;
|
|
|
|
use Yii;
|
|
|
|
/**
|
|
* This is the model class for table "yii2_role".
|
|
*
|
|
* @property int $id
|
|
* @property string|null $name
|
|
* @property string|null $role_code
|
|
* @property string|null $description
|
|
* @property int|null $created_at 创建时间
|
|
* @property int|null $updated_at
|
|
*/
|
|
class Role extends \yii\db\ActiveRecord
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public static function tableName()
|
|
{
|
|
return '{{%role}}';
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
[['created_at', 'updated_at'], 'integer'],
|
|
[['name', 'role_code'], 'string', 'max' => 50],
|
|
[['description'], 'string', 'max' => 255],
|
|
[['name'], 'unique'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function attributeLabels()
|
|
{
|
|
return [
|
|
'id' => 'ID',
|
|
'name' => 'Name',
|
|
'role_code' => 'Role Code',
|
|
'description' => 'Description',
|
|
'created_at' => '创建时间',
|
|
'updated_at' => 'Updated At',
|
|
];
|
|
}
|
|
}
|