Story.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace app\models\base;
  3. use Yii;
  4. /**
  5. * This is the model class for table "story".
  6. *
  7. * @property int $id
  8. * @property int|null $topic_id
  9. * @property string|null $title
  10. * @property string $meta_title
  11. * @property string $url
  12. * @property string|null $keywords
  13. * @property string $description
  14. * @property int $order
  15. * @property int $active
  16. * @property string $show
  17. * @property string $ext
  18. */
  19. class Story extends \yii\db\ActiveRecord
  20. {
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public static function tableName()
  25. {
  26. return 'story';
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function rules()
  32. {
  33. return [
  34. [['topic_id', 'order', 'active'], 'integer'],
  35. [['meta_title', 'url', 'description', 'ext'], 'required'],
  36. [['keywords', 'show', 'ext'], 'string'],
  37. [['title'], 'string', 'max' => 255],
  38. [['meta_title'], 'string', 'max' => 70],
  39. [['url'], 'string', 'max' => 128],
  40. [['description'], 'string', 'max' => 300],
  41. ];
  42. }
  43. /**
  44. * {@inheritdoc}
  45. */
  46. public function attributeLabels()
  47. {
  48. return [
  49. 'id' => 'ID',
  50. 'topic_id' => 'Topic ID',
  51. 'title' => 'Title',
  52. 'meta_title' => 'Meta Title',
  53. 'url' => 'Url',
  54. 'keywords' => 'Keywords',
  55. 'description' => 'Description',
  56. 'order' => 'Order',
  57. 'active' => 'Active',
  58. 'show' => 'Show',
  59. 'ext' => 'Ext',
  60. ];
  61. }
  62. /**
  63. * {@inheritdoc}
  64. * @return StoryQuery the active query used by this AR class.
  65. */
  66. public static function find()
  67. {
  68. return new StoryQuery(get_called_class());
  69. }
  70. }