NotifyCategory.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace common\models;
  3. /**
  4. * This is the model class for table "pop_notify_category".
  5. *
  6. * @property integer $id
  7. * @property string $name
  8. * @property string $text
  9. */
  10. class NotifyCategory extends \yii\db\ActiveRecord
  11. {
  12. const REPLY = 1;
  13. const SUGGEST = 2;
  14. const COMMENT_ARTICLE = 3;
  15. const FAVOURITE = 4;
  16. const UP_ARTICLE = 5;
  17. const MESSAGE = 6;
  18. const REWARD = 7;
  19. const FOLLOW = 8;
  20. const UP_COMMENT = 9;
  21. const COMMENT_SUGGEST = 10;
  22. /**
  23. * @inheritdoc
  24. */
  25. public static function tableName()
  26. {
  27. return '{{%notify_category}}';
  28. }
  29. /**
  30. * @inheritdoc
  31. */
  32. public function rules()
  33. {
  34. return [
  35. [['name'], 'string', 'max' => 50],
  36. [['text'], 'string', 'max' => 255],
  37. [['name'], 'unique'],
  38. ];
  39. }
  40. /**
  41. * @inheritdoc
  42. */
  43. public function attributeLabels()
  44. {
  45. return [
  46. 'id' => 'ID',
  47. 'name' => 'Name',
  48. 'text' => 'Text',
  49. ];
  50. }
  51. }