PHP 클래스 Pop\Service\Locator

저자: Nick Sagona, III ([email protected])
파일 보기 프로젝트 열기: nicksagona/PopPHP 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$loaded array Services that are loaded (instantiated)
$services array Services

공개 메소드들

메소드 설명
__construct ( array $services = null ) : Locator Constructor
get ( string $name ) : mixed Get a service object.
remove ( string $name ) : Locator Remove a service
set ( string $name, mixed $call, mixed $params = null ) : Locator Set a service object. It will overwrite any previous service with the same name.

보호된 메소드들

메소드 설명
load ( string $name ) : Locator Load a service object. It will overwrite any previous service with the same name.

메소드 상세

__construct() 공개 메소드

Instantiate the service locator object. The optional $services parameter can contain a closure or an array of call/param keys that define what to call when the service is needed. Valid examples are ('params' are optional): $services = array( 'service1' => function($locator) {...}, 'service2' => array( 'call' => 'SomeClass', 'params' => array(...) ), 'service3' => array( 'call' => 'SomeClass', 'params' => function() {...} ) );
public __construct ( array $services = null ) : Locator
$services array
리턴 Locator

get() 공개 메소드

Get a service object.
public get ( string $name ) : mixed
$name string
리턴 mixed

load() 보호된 메소드

Load a service object. It will overwrite any previous service with the same name.
protected load ( string $name ) : Locator
$name string
리턴 Locator

remove() 공개 메소드

Remove a service
public remove ( string $name ) : Locator
$name string
리턴 Locator

set() 공개 메소드

Set a service object. It will overwrite any previous service with the same name.
public set ( string $name, mixed $call, mixed $params = null ) : Locator
$name string
$call mixed
$params mixed
리턴 Locator

프로퍼티 상세

$loaded 보호되어 있는 프로퍼티

Services that are loaded (instantiated)
protected array $loaded
리턴 array

$services 보호되어 있는 프로퍼티

Services
protected array $services
리턴 array