You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.2 KiB

  1. <?php
  2. namespace backend\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "cat".
  6. *
  7. * @property int $id
  8. * @property string $cat_name
  9. * @property string $icon
  10. * @property int $icon_type
  11. * @property string $description
  12. * @property int $sort_order
  13. * @property int $created_at
  14. * @property int $updated_at
  15. */
  16. class Cat extends \yii\db\ActiveRecord
  17. {
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public static function tableName()
  22. {
  23. return 'cat';
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function rules()
  29. {
  30. return [
  31. [['cat_name'], 'required'],
  32. [['icon_type', 'sort_order', 'created_at', 'updated_at'], 'integer'],
  33. [['description'], 'string'],
  34. [['cat_name', 'icon'], 'string', 'max' => 64],
  35. ];
  36. }
  37. /**
  38. * {@inheritdoc}
  39. */
  40. public function attributeLabels()
  41. {
  42. return [
  43. 'id' => 'ID',
  44. 'cat_name' => 'Cat Name',
  45. 'icon' => 'Icon',
  46. 'icon_type' => 'Icon Type',
  47. 'description' => 'Description',
  48. 'sort_order' => 'Sort Order',
  49. 'created_at' => 'Created At',
  50. 'updated_at' => 'Updated At',
  51. ];
  52. }
  53. }