PHP 클래스 Ergo\Registry

파일 보기 프로젝트 열기: 99designs/ergo 1 사용 예제들

공개 메소드들

메소드 설명
__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 )