PHP Интерфейс Symfony\Component\DependencyInjection\ContainerInterface

Автор: Fabien Potencier ([email protected])
Автор: Johannes M. Schmitt ([email protected])
Показать файл Открыть проект Примеры использования интерфейса

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

Метод Описание
addScope ( Symfony\Component\DependencyInjection\ScopeInterface $scope ) : void Adds a scope to the container
enterScope ( string $name ) : void Enters the given scope
get ( string $id, integer $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE ) : object Gets a service.
getParameter ( string $name ) : mixed Gets a parameter.
has ( string $id ) : boolean Returns true if the given service is defined.
hasParameter ( string $name ) : boolean Checks if a parameter exists.
hasScope ( string $name ) : boolean Whether this container has the given scope
isScopeActive ( string $name ) : boolean Determines whether the given scope is currently active.
leaveScope ( string $name ) : void Leaves the current scope, and re-enters the parent scope
set ( string $id, object $service, string $scope = self::SCOPE_CONTAINER ) Sets a service.
setParameter ( string $name, mixed $value ) Sets a parameter.

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

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

Adds a scope to the container
public addScope ( Symfony\Component\DependencyInjection\ScopeInterface $scope ) : void
$scope Symfony\Component\DependencyInjection\ScopeInterface
Результат void

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

Enters the given scope
public enterScope ( string $name ) : void
$name string
Результат void

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

Gets a service.
См. также: Reference
public get ( string $id, integer $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE ) : object
$id string The service identifier
$invalidBehavior integer The behavior when the service does not exist
Результат object The associated service

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

Gets a parameter.
public getParameter ( string $name ) : mixed
$name string The parameter name
Результат mixed The parameter value

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

Returns true if the given service is defined.
public has ( string $id ) : boolean
$id string The service identifier
Результат boolean true if the service is defined, false otherwise

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

Checks if a parameter exists.
public hasParameter ( string $name ) : boolean
$name string The parameter name
Результат boolean The presence of parameter in container

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

Whether this container has the given scope
public hasScope ( string $name ) : boolean
$name string
Результат boolean

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

It does however not check if the scope actually exists.
public isScopeActive ( string $name ) : boolean
$name string
Результат boolean

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

Leaves the current scope, and re-enters the parent scope
public leaveScope ( string $name ) : void
$name string
Результат void

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

Sets a service.
public set ( string $id, object $service, string $scope = self::SCOPE_CONTAINER )
$id string The service identifier
$service object The service instance
$scope string The scope of the service

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

Sets a parameter.
public setParameter ( string $name, mixed $value )
$name string The parameter name
$value mixed The parameter value