/** * @inheritdoc */ public function rules() { return array_merge(parent::rules(), [[['name', 'type', 'content'], 'required'], [['content'], 'string'], [['name', 'type', 'title'], 'string', 'max' => 200], [['name'], 'unique', 'when' => function () { return !$this->isTranslation(); }]]); }