Posts.php 879 B

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