Role.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\modules\admin\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%role}}".
  6. *
  7. * @property int $role_id 角色ID
  8. * @property string $role_name 角色名称
  9. * @property string|null $description 角色描述
  10. * @property int $disabled 状态:1,禁用
  11. */
  12. class Role extends \app\common\models\EActiveRecord
  13. {
  14. /**
  15. * {@inheritdoc}
  16. */
  17. public static function tableName()
  18. {
  19. return '{{%role}}';
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function rules()
  25. {
  26. return [
  27. [['role_name'], 'required'],
  28. [['description'], 'string'],
  29. [['disabled'], 'integer'],
  30. [['role_name'], 'string', 'max' => 50],
  31. ];
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function attributeLabels()
  37. {
  38. return [
  39. 'role_id' => Yii::t('attr','role.role_id'),
  40. 'role_name' => Yii::t('attr','role.role_name'),
  41. 'description' => Yii::t('attr','role.description'),
  42. 'disabled' => Yii::t('attr','role.disabled'),
  43. ];
  44. }
  45. }