public static function setConfig($key, $config = null)
    {
        if (is_array($config)) {
            $config['name'] = $key;
        }

        static::_setConfig($key, $config);
    }
public static function setConfig($key, $config = null)
    {
        if (is_array($config)) {
            $config['name'] = $key;
        }

        static::_setConfig($key, $config);
    }
public static function setConfig ( $ key , $ config = null ) { if ( is_array ( $ config ) ) { $ config [ 'name' ] = $ key ; } static :: _setConfig ( $ key , $ config ) ; }
Configure a new connection object.

The connection will not be constructed until it is first used.

@param string|array $key The name of the connection config, or an array of multiple configs.
@param array|null $config An array of name => config data for adapter.
@return void
@throws \Cake\Core\Exception\Exception When trying to modify an existing config.
@see \Cake\Core\StaticConfigTrait::config()
Configure a new connection object .