TimestampBehavior::className(), 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'], ], ], ]; } /** * @inheritdoc */ public static function tableName() { return '{{%video_cat}}'; // 数据库表名 } /** * @inheritdoc */ public function rules() { return [ [['store_id', 'name',], 'required'], [['store_id', 'status', 'is_delete'], 'integer'], [['created_at', 'updated_at'], 'safe'], [['name'], 'string', 'max' => 255], [['status', 'is_delete'], 'default', 'value' => 0] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => 'Store ID', 'name' => 'Name', 'status' => 'Status', 'created_at' => 'Created At', 'updated_at' => 'Updated At', 'is_delete' => 'Is Delete', ]; } }