protected function setSingleRelation($relationName, $value)
    {
        /** @var BaseActiveRecord $owner */
        $owner = $this->owner;
        /** @var ActiveQuery $relation */
        $relation = $owner->getRelation($relationName);
        if (!($value instanceof $relation->modelClass)) {
            $value = $this->processModelAsArray($value, $relation, $relationName);
        }
        $this->_newRelationValue[$relationName] = $value;
        $owner->populateRelation($relationName, $value);
    }
protected function setSingleRelation($relationName, $value)
    {
        /** @var BaseActiveRecord $owner */
        $owner = $this->owner;
        /** @var ActiveQuery $relation */
        $relation = $owner->getRelation($relationName);
        if (!($value instanceof $relation->modelClass)) {
            $value = $this->processModelAsArray($value, $relation, $relationName);
        }
        $this->_newRelationValue[$relationName] = $value;
        $owner->populateRelation($relationName, $value);
    }
protected function setSingleRelation ( $ relationName , $ value ) { /** @var BaseActiveRecord $owner */ $ owner = $ this -> owner ; /** @var ActiveQuery $relation */ $ relation = $ owner -> getRelation ( $ relationName ) ; if ( ! ( $ value instanceof $ relation -> modelClass ) ) { $ value = $ this -> processModelAsArray ( $ value , $ relation , $ relationName ) ; } $ this -> _newRelationValue [ $ relationName ] = $ value ; $ owner -> populateRelation ( $ relationName , $ value ) ; }
Set the named single relation with the given value
@param string $relationName
@param $value
@throws \yii\base\InvalidArgumentException
Set the named single relation with the given value