lithium\core\StaticObject::_instance PHP Method

_instance() protected static method

Returns an instance of a class with given config. The name could be a key from the classes array, a fully namespaced class name, or an object. Typically this method is used in _init to create the dependencies used in the current class.
protected static _instance ( string | object $name, array $options = [] ) : object
$name string | object A `classes` key or fully-namespaced class name.
$options array The configuration passed to the constructor.
return object
    protected static function _instance($name, array $options = array())
    {
        if (is_string($name) && isset(static::$_classes[$name])) {
            $name = static::$_classes[$name];
        }
        return Libraries::instance(null, $name, $options);
    }