public function beforeValidate()
    {
        $this->reset();
        foreach ($this->relations as $key => $relation) {
            $data = is_array($relation) ? $relation : [];
            $relation = is_array($relation) ? $key : $relation;
            $ruleLoad = FormHelper::loadRelation($this->owner, $relation, Yii::$app->request->post(), $data);
            $this->savingModels[$relation] = $ruleLoad['models'];
            foreach ($ruleLoad['errors'] as $errors) {
                $this->owner->addError($relation, json_encode($errors, JSON_UNESCAPED_UNICODE));
            }
        }
    }
public function beforeValidate()
    {
        $this->reset();
        foreach ($this->relations as $key => $relation) {
            $data = is_array($relation) ? $relation : [];
            $relation = is_array($relation) ? $key : $relation;
            $ruleLoad = FormHelper::loadRelation($this->owner, $relation, Yii::$app->request->post(), $data);
            $this->savingModels[$relation] = $ruleLoad['models'];
            foreach ($ruleLoad['errors'] as $errors) {
                $this->owner->addError($relation, json_encode($errors, JSON_UNESCAPED_UNICODE));
            }
        }
    }
public function beforeValidate ( ) { $ this -> reset ( ) ; foreach ( $ this -> relations as $ key => $ relation ) { $ data = is_array ( $ relation ) ? $ relation : [ ] ; $ relation = is_array ( $ relation ) ? $ key : $ relation ; $ ruleLoad = FormHelper :: loadRelation ( $ this -> owner , $ relation , Yii :: $ app -> request -> post ( ) , $ data ) ; $ this -> savingModels [ $ relation ] = $ ruleLoad [ 'models' ] ; foreach ( $ ruleLoad [ 'errors' ] as $ errors ) { $ this -> owner -> addError ( $ relation , json_encode ( $ errors , JSON_UNESCAPED_UNICODE ) ) ; } } }
Validates children models according to their class rules
Validates children models according to their class rules