src/App/Template/DynamicAppConfigTrait.php
protected function setAppConfig(AppConfig $appConfig)
    {
        if ($this->appConfig !== null) {
            throw new InvalidArgumentException(
                'Application configset already assigned.'
            );
        }

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

        return $this;
    }
protected function setAppConfig(AppConfig $appConfig)
    {
        if ($this->appConfig !== null) {
            throw new InvalidArgumentException(
                'Application configset already assigned.'
            );
        }

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

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

Note: This method should be called after {@see self::setDynamicConfig()}
or {@see self::setDynamicConfigClass()}.

@param  AppConfig $appConfig A Charcoal application configset.
@throws InvalidArgumentException If a configset already exists.
@return self
Set the application s configset .