/** * @inheritdoc */ public function rules() { if (!$this->_rules) { foreach ($this->relations as $model) { $this->_rules = ArrayHelper::merge($this->_rules, $model->rules()); } $this->_rules = ArrayHelper::merge($this->_rules, $this->model->rules()); } return $this->_rules; }