interface ContainerInterface
ContainerInterface is the interface implemented by service container classes.
Constants
| EXCEPTION_ON_INVALID_REFERENCE |
|
| NULL_ON_INVALID_REFERENCE |
|
| IGNORE_ON_INVALID_REFERENCE |
|
| SCOPE_CONTAINER |
|
| SCOPE_PROTOTYPE |
|
Methods
|
set(string $id, object $service, string $scope = self::SCOPE_CONTAINER)
Sets a service. |
||
| object |
get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
Gets a service. |
|
| Boolean |
has(string $id)
Returns true if the given service is defined. |
|
| mixed |
getParameter(string $name)
Gets a parameter. |
|
| Boolean |
hasParameter(string $name)
Checks if a parameter exists. |
|
|
setParameter(string $name, mixed $value)
Sets a parameter. |
||
|
enterScope(string $name)
Enters the given scope |
||
|
leaveScope(string $name)
Leaves the current scope, and re-enters the parent scope |
||
|
addScope(ScopeInterface $scope)
Adds a scope to the container |
||
| Boolean |
hasScope(string $name)
Whether this container has the given scope |
|
| Boolean |
isScopeActive(string $name)
Determines whether the given scope is currently active. |
Details
at line 41
public
set(string $id, object $service, string $scope = self::SCOPE_CONTAINER)
Sets a service.
at line 57
public object
get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
Gets a service.
at line 68
public Boolean
has(string $id)
Returns true if the given service is defined.
at line 81
public mixed
getParameter(string $name)
Gets a parameter.
at line 92
public Boolean
hasParameter(string $name)
Checks if a parameter exists.
at line 102
public
setParameter(string $name, mixed $value)
Sets a parameter.
at line 111
public
enterScope(string $name)
Enters the given scope
at line 120
public
leaveScope(string $name)
Leaves the current scope, and re-enters the parent scope
at line 129
public
addScope(ScopeInterface $scope)
Adds a scope to the container
at line 140
public Boolean
hasScope(string $name)
Whether this container has the given scope
at line 153
public Boolean
isScopeActive(string $name)
Determines whether the given scope is currently active.
It does however not check if the scope actually exists.