Category.php 708 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "category".
  6. *
  7. * @property integer $id
  8. * @property string $name
  9. */
  10. class Category extends \yii\db\ActiveRecord
  11. {
  12. /**
  13. * @inheritdoc
  14. */
  15. public static function tableName()
  16. {
  17. return 'category';
  18. }
  19. /**
  20. * @inheritdoc
  21. */
  22. public function rules()
  23. {
  24. return [
  25. [['name'], 'required'],
  26. [['name'], 'string', 'max' => 255]
  27. ];
  28. }
  29. /**
  30. * @inheritdoc
  31. */
  32. public function attributeLabels()
  33. {
  34. return [
  35. 'id' => Yii::t('app', 'ID'),
  36. 'name' => Yii::t('app', 'Category Name'),
  37. ];
  38. }
  39. }