PHP 클래스 Go\Core\Container

파일 보기 프로젝트 열기: goaop/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$tags array Store identifiers os services by tags
$values array List of services in the container

공개 메소드들

메소드 설명
get ( string $id ) : mixed Return a service or value from the container
getByTag ( string $tag ) : array Return list of service tagged with marker
has ( string $id ) : boolean Checks if item with specified id is present in the container
set ( string $id, mixed $value, array $tags = [] ) Set a service into the container
share ( string $id, callable $value, array $tags = [] ) Set a shared value in the container

메소드 상세

get() 공개 메소드

Return a service or value from the container
public get ( string $id ) : mixed
$id string Identifier
리턴 mixed

getByTag() 공개 메소드

Return list of service tagged with marker
public getByTag ( string $tag ) : array
$tag string Tag to select
리턴 array

has() 공개 메소드

Checks if item with specified id is present in the container
public has ( string $id ) : boolean
$id string Identifier
리턴 boolean

set() 공개 메소드

Set a service into the container
public set ( string $id, mixed $value, array $tags = [] )
$id string Identifier
$value mixed Value to store
$tags array Additional tags

share() 공개 메소드

Set a shared value in the container
public share ( string $id, callable $value, array $tags = [] )
$id string Identifier
$value callable Value to store
$tags array Additional tags

프로퍼티 상세

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

Store identifiers os services by tags
protected array $tags
리턴 array

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

List of services in the container
protected array $values
리턴 array