public function setRelationScenario($relationName, $scenario)
    {
        /** @var BaseActiveRecord $owner */
        $owner = $this->owner;
        $relation = $owner->getRelation($relationName, false);
        if (in_array($relationName, $this->_relations) && !is_null($relation)) {
            $this->_relationsScenario[$relationName] = $scenario;
        } else {
            throw new InvalidArgumentException('Unknown ' . $relationName . ' relation');
        }

    }
public function setRelationScenario($relationName, $scenario)
    {
        /** @var BaseActiveRecord $owner */
        $owner = $this->owner;
        $relation = $owner->getRelation($relationName, false);
        if (in_array($relationName, $this->_relations) && !is_null($relation)) {
            $this->_relationsScenario[$relationName] = $scenario;
        } else {
            throw new InvalidArgumentException('Unknown ' . $relationName . ' relation');
        }

    }
public function setRelationScenario ( $ relationName , $ scenario ) { /** @var BaseActiveRecord $owner */ $ owner = $ this -> owner ; $ relation = $ owner -> getRelation ( $ relationName , false ) ; if ( in_array ( $ relationName , $ this -> _relations ) && ! is_null ( $ relation ) ) { $ this -> _relationsScenario [ $ relationName ] = $ scenario ; } else { throw new InvalidArgumentException ( 'Unknown ' . $ relationName . ' relation' ) ; } }
Set the scenario for a given relation
@param $relationName
@param $scenario
@throws InvalidArgumentException
Set the scenario for a given relation