protected function checkRelationExistence($name)
    {
        $getter = 'get' . ucfirst($name);
        $class = get_class($this->owner);

        if (method_exists($this->owner, $getter)) {
            /** @var ActiveQuery $value */
            $value = $this->owner->$getter();

            if (!($value instanceof ActiveQueryInterface)) {
                throw new InvalidConfigException("Value of relation '$getter' not valid");
            }

            $this->models[$name]['multiple'] = $value->multiple;
        } else {
            throw new InvalidConfigException("Relation '$class::$getter' for attribute '$name' does not exists");
        }
    }
protected function checkRelationExistence($name)
    {
        $getter = 'get' . ucfirst($name);
        $class = get_class($this->owner);

        if (method_exists($this->owner, $getter)) {
            /** @var ActiveQuery $value */
            $value = $this->owner->$getter();

            if (!($value instanceof ActiveQueryInterface)) {
                throw new InvalidConfigException("Value of relation '$getter' not valid");
            }

            $this->models[$name]['multiple'] = $value->multiple;
        } else {
            throw new InvalidConfigException("Relation '$class::$getter' for attribute '$name' does not exists");
        }
    }
protected function checkRelationExistence ( $ name ) { $ getter = 'get' . ucfirst ( $ name ) ; $ class = get_class ( $ this -> owner ) ; if ( method_exists ( $ this -> owner , $ getter ) ) { /** @var ActiveQuery $value */ $ value = $ this -> owner -> $ getter ( ) ; if ( ! ( $ value instanceof ActiveQueryInterface ) ) { throw new InvalidConfigException ( "Value of relation '$getter' not valid" ) ; } $ this -> models [ $ name ] [ 'multiple' ] = $ value -> multiple ; } else { throw new InvalidConfigException ( "Relation '$class::$getter' for attribute '$name' does not exists" ) ; } }
Check if relation with given name exists in model
@param $name
@throws InvalidConfigException
Check if relation with given name exists in model