lithium\core\Adaptable::_initAdapter()

protected static method

Provides an extension point for modifying how adapters are instantiated.

Parameters

  • string $class

    The fully-namespaced class name of the adapter to instantiate.

  • array $config

    The configuration array to be passed to the adapter instance. See the $config parameter of Object::__construct().

Returns

object

The adapter's class.

Filter

This method can be filtered.

Source

	protected static function _initAdapter($class, array $config) {
		$params = compact('class', 'config');

		return Filters::run(get_called_class(), __FUNCTION__, $params, function($params) {
			return new $params['class']($params['config']);
		});
	}