| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace common\models;
- use Yii;
- /**
- * This is the model class for table "{{%ARTICLE}}".
- *
- * @property string $ID
- * @property string $TITLE 标题
- * @property string $CID 分类ID
- * @property string $CONTENT 内容
- * @property int $STATUS 状态
- * @property int $SORT 排序值
- * @property int $CREATED_AT 创建时间
- */
- class Article extends \common\components\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%ARTICLE}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['CID', 'CREATED_AT'], 'required'],
- [['STATUS', 'CREATED_AT', 'SORT'], 'integer'],
- [['ID', 'CID'], 'string', 'max' => 32],
- [['TITLE'], 'string', 'max' => 255],
- [['CONTENT'], 'string', 'max' => 4000],
- [['TITLE'], 'unique'],
- [['ID'], 'unique'],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'ID' => 'ID',
- 'TITLE' => Yii::t('app', 'title'),
- 'CID' => Yii::t('app', 'category'),
- 'CONTENT' => Yii::t('app', 'content'),
- 'STATUS' => Yii::t('app', 'state'),
- 'Order' => Yii::t('app', 'sort'),
- 'CREATED_AT' => Yii::t('app', 'createAt'),
- ];
- }
- }
|