/** * @inheritdoc */ public function rules() { return array_merge(parent::rules(), [[['type'], 'required'], [['type', 'category'], 'string', 'max' => 255], [['image', 'previewText'], 'string'], ['publishTime', 'string', 'max' => 255], ['name', 'unique', 'filter' => function ($query) { /** @type Query $query */ $query->andWhere(['type' => $this->type]); }]]); }
public function rules() { return array_merge(parent::rules(), [[['parentUid'], 'string', 'max' => 255]]); }