RoleResource.php 895 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace app\modules\admin\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%role_resource}}".
  6. *
  7. * @property int $role_resource_id ID
  8. * @property int $role_id 角色ID
  9. * @property string $hash 资源ID
  10. */
  11. class RoleResource extends \app\common\models\EActiveRecord
  12. {
  13. /**
  14. * {@inheritdoc}
  15. */
  16. public static function tableName()
  17. {
  18. return '{{%role_resource}}';
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function rules()
  24. {
  25. return [
  26. [['role_id', 'hash'], 'required'],
  27. [['role_id'], 'integer'],
  28. [['hash'], 'string', 'max' => 50],
  29. ];
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function attributeLabels()
  35. {
  36. return [
  37. 'role_resource_id' => 'Role Resource ID',
  38. 'role_id' => 'Role ID',
  39. 'hash' => 'Hash',
  40. ];
  41. }
  42. }