ArticleModule.php 848 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace common\models;
  3. /**
  4. * This is the model class for table "{{%article_module}}".
  5. *
  6. * @property integer $id
  7. * @property string $name
  8. * @property string $title
  9. */
  10. class ArticleModule extends \yii\db\ActiveRecord
  11. {
  12. /**
  13. * @inheritdoc
  14. */
  15. public static function tableName()
  16. {
  17. return '{{%article_module}}';
  18. }
  19. /**
  20. * @inheritdoc
  21. */
  22. public function rules()
  23. {
  24. return [
  25. [['name', 'title'], 'string', 'max' => 50],
  26. ];
  27. }
  28. /**
  29. * @inheritdoc
  30. */
  31. public function attributeLabels()
  32. {
  33. return [
  34. 'id' => 'ID',
  35. 'name' => 'Name',
  36. 'title' => 'Title',
  37. ];
  38. }
  39. public static function getTypeEnum()
  40. {
  41. return self::find()->select('title')->indexBy('name')->column();
  42. }
  43. }