lithium\core\Adaptable::_strategy PHP Method

_strategy() protected static method

Looks up a strategy by class by name.
See also: lithium\core\libraries::locate()
protected static _strategy ( string $name, array $paths = [] ) : string
$name string The strategy to locate.
$paths array Optional array of search paths that will be checked.
return string Returns a fully-namespaced class reference to the adapter class.
    protected static function _strategy($name, $paths = array())
    {
        if (!$name) {
            $self = get_called_class();
            throw new ConfigException("No strategy set for configuration in class `{$self}`.");
        }
        if (!($class = static::_locate($paths, $name))) {
            $self = get_called_class();
            throw new ConfigException("Could not find strategy `{$name}` in class `{$self}`.");
        }
        return $class;
    }