PHP Класс Ergo\Registry

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__get ( $key ) Magic property access
__isset ( $key ) Magic property access for isset
factory ( $key, $factory ) Registers a {@link Factory} or closure to be invoked on the first lookup
handle ( $key ) Creates a handle to a particular registry key
isRegistered ( $key ) Returns whether an object
lookup ( $key, $closure = null ) : Object Looks up a key in the registry, with an optional closure that that will be executed and the result stored if the key doesn't exist (and there is no trigger).
register ( $key, $object ) Registers an object for later retrieval by key. Any existing key is overwritten.
trigger ( $keys, $callable ) Sets a closure that is called on a lookup miss

Приватные методы

Метод Описание
_memoize ( $object ) : Closure Returns a closure that returns an object.

Описание методов

__get() публичный Метод

Magic property access
public __get ( $key )

__isset() публичный Метод

Magic property access for isset
public __isset ( $key )

factory() публичный Метод

Registers a {@link Factory} or closure to be invoked on the first lookup
public factory ( $key, $factory )

handle() публичный Метод

Creates a handle to a particular registry key
public handle ( $key )

isRegistered() публичный Метод

Returns whether an object
public isRegistered ( $key )

lookup() публичный Метод

Looks up a key in the registry, with an optional closure that that will be executed and the result stored if the key doesn't exist (and there is no trigger).
public lookup ( $key, $closure = null ) : Object
Результат Object

register() публичный Метод

Registers an object for later retrieval by key. Any existing key is overwritten.
public register ( $key, $object )

trigger() публичный Метод

Sets a closure that is called on a lookup miss
public trigger ( $keys, $callable )