src/App/Template/DynamicAppConfigTrait.php
protected function setDynamicConfig(EntityInterface $dynConfig)
    {
        if ($this->dynamicConfig !== null) {
            throw new InvalidArgumentException(
                'Dynamic configset already assigned.'
            );
        }

        if ($this->appConfig !== null) {
            if ($dynConfig instanceof DelegatesAwareInterface) {
                $dynConfig->prependDelegate($this->appConfig);
            } else {
                $appConfig['dynamic'] = $dynConfig;
                $appConfig->prependDelegate($dynConfig);
            }
        }

        $this->dynamicConfig = $dynConfig;
        return $this;
    }
protected function setDynamicConfig(EntityInterface $dynConfig)
    {
        if ($this->dynamicConfig !== null) {
            throw new InvalidArgumentException(
                'Dynamic configset already assigned.'
            );
        }

        if ($this->appConfig !== null) {
            if ($dynConfig instanceof DelegatesAwareInterface) {
                $dynConfig->prependDelegate($this->appConfig);
            } else {
                $appConfig['dynamic'] = $dynConfig;
                $appConfig->prependDelegate($dynConfig);
            }
        }

        $this->dynamicConfig = $dynConfig;
        return $this;
    }
protected function setDynamicConfig ( EntityInterface $ dynConfig ) { if ( $ this -> dynamicConfig !== null ) { throw new InvalidArgumentException ( 'Dynamic configset already assigned.' ) ; } if ( $ this -> appConfig !== null ) { if ( $ dynConfig instanceof DelegatesAwareInterface ) { $ dynConfig -> prependDelegate ( $ this -> appConfig ) ; } else { $ appConfig [ 'dynamic' ] = $ dynConfig ; $ appConfig -> prependDelegate ( $ dynConfig ) ; } } $ this -> dynamicConfig = $ dynConfig ; return $ this ; }
Set the dynamic configset instance.

Note: This method should be called before {@see self::setAppConfig()}.

@param  EntityInterface $dynConfig A dynamic configset.
@throws InvalidArgumentException If a configset already exists.
@return self
Set the dynamic configset instance .