FriendLink.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%friend_link}}".
  6. *
  7. * @property int $id ID
  8. * @property string $title 文本
  9. * @property string $url 链接
  10. * @property string $logo LOGO
  11. * @property int $is_image 1:图片链接 0:文字链接
  12. * @property int $type 分类
  13. * @property int $list_order 排序
  14. * @property int $disabled 1:禁用
  15. */
  16. class FriendLink extends \app\common\models\EActiveRecord
  17. {
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public static function tableName()
  22. {
  23. return '{{%friend_link}}';
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function rules()
  29. {
  30. return [
  31. [['title', 'url'], 'required'],
  32. [['is_image', 'type', 'list_order', 'disabled'], 'integer'],
  33. [['title'], 'string', 'max' => 30],
  34. [['url'], 'string', 'max' => 100],
  35. [['logo'], 'string', 'max' => 500],
  36. ];
  37. }
  38. /**
  39. * {@inheritdoc}
  40. */
  41. public function attributeLabels()
  42. {
  43. return [
  44. 'id' => Yii::t('attr','friend_link.id'),
  45. 'title' => Yii::t('attr','friend_link.title'),
  46. 'url' => Yii::t('attr','friend_link.url'),
  47. 'logo' => Yii::t('attr','friend_link.logo'),
  48. 'is_image' => Yii::t('attr','friend_link.is_image'),
  49. 'type' => Yii::t('attr','friend_link.type'),
  50. 'list_order' => Yii::t('attr','friend_link.list_order'),
  51. 'disabled' => Yii::t('attr','friend_link.disabled'),
  52. ];
  53. }
  54. }