lithium\core\Adaptable::_initAdapter PHP Method

_initAdapter() protected static method

Provides an extension point for modifying how adapters are instantiated.
See also: lithium\core\Object::__construct()
protected static _initAdapter ( string $class, array $config ) : object
$class string The fully-namespaced class name of the adapter to instantiate.
$config array The configuration array to be passed to the adapter instance. See the `$config` parameter of `Object::__construct()`.
return object The adapter's class.
    protected static function _initAdapter($class, array $config)
    {
        return static::_filter(__FUNCTION__, compact('class', 'config'), function ($self, $params) {
            return new $params['class']($params['config']);
        });
    }