protected function validateRelationModel($prettyRelationName, $relationName, BaseActiveRecord $relationModel)
    {
        /** @var BaseActiveRecord $model */
        $model = $this->owner;
        if (!is_null($relationModel) && ($relationModel->isNewRecord || count($relationModel->getDirtyAttributes()))) {
            Yii::debug("Validating {$prettyRelationName} relation model using " . $relationModel->scenario . ' scenario', __METHOD__);
            if (!$relationModel->validate()) {
                $this->_addError($relationModel, $model, $relationName, $prettyRelationName);
            }

        }
    }
protected function validateRelationModel($prettyRelationName, $relationName, BaseActiveRecord $relationModel)
    {
        /** @var BaseActiveRecord $model */
        $model = $this->owner;
        if (!is_null($relationModel) && ($relationModel->isNewRecord || count($relationModel->getDirtyAttributes()))) {
            Yii::debug("Validating {$prettyRelationName} relation model using " . $relationModel->scenario . ' scenario', __METHOD__);
            if (!$relationModel->validate()) {
                $this->_addError($relationModel, $model, $relationName, $prettyRelationName);
            }

        }
    }
protected function validateRelationModel ( $ prettyRelationName , $ relationName , BaseActiveRecord $ relationModel ) { /** @var BaseActiveRecord $model */ $ model = $ this -> owner ; if ( ! is_null ( $ relationModel ) && ( $ relationModel -> isNewRecord || count ( $ relationModel -> getDirtyAttributes ( ) ) ) ) { Yii :: debug ( "Validating {$prettyRelationName} relation model using " . $ relationModel -> scenario . ' scenario' , __METHOD__ ) ; if ( ! $ relationModel -> validate ( ) ) { $ this -> _addError ( $ relationModel , $ model , $ relationName , $ prettyRelationName ) ; } } }
Validate a relation model and add an error message to owner model attribute if needed
@param string $prettyRelationName
@param string $relationName
@param BaseActiveRecord $relationModel
Validate a relation model and add an error message to owner model attribute if needed