예제 #1
0
 /**
  * @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]);
     }]]);
 }
예제 #2
0
 public function rules()
 {
     return array_merge(parent::rules(), [[['parentUid'], 'string', 'max' => 255]]);
 }