PHP Класс Go\Core\Container

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

Защищенные свойства (Protected)

Свойство Тип Описание
$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