ResettableContainerInterface
interface ResettableContainerInterface implements ContainerInterface
ResettableContainerInterface defines additional resetting functionality for containers, allowing to release shared services when the container is not needed anymore.
Methods
Sets a service.
Gets a service.
Resets shared services from the container.
Details
in ContainerInterface at line line 41
set(string $id, object $service, string $scope = self::SCOPE_CONTAINER)
Sets a service.
Note: The $scope parameter is deprecated since version 2.8 and will be removed in 3.0.
in ContainerInterface at line line 56
object
get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
Gets a service.
in ContainerInterface at line line 65
bool
has(string $id)
Returns true if the given service is defined.
in ContainerInterface at line line 76
mixed
getParameter(string $name)
Gets a parameter.
in ContainerInterface at line line 85
bool
hasParameter(string $name)
Checks if a parameter exists.
in ContainerInterface at line line 93
setParameter(string $name, mixed $value)
Sets a parameter.
in ContainerInterface at line line 102
enterScope(string $name)
deprecated
deprecated
Enters the given scope.
in ContainerInterface at line line 111
leaveScope(string $name)
deprecated
deprecated
Leaves the current scope, and re-enters the parent scope.
in ContainerInterface at line line 120
addScope(ScopeInterface $scope)
deprecated
deprecated
Adds a scope to the container.
in ContainerInterface at line line 131
bool
hasScope(string $name)
deprecated
deprecated
Whether this container has the given scope.
in ContainerInterface at line line 144
bool
isScopeActive(string $name)
deprecated
deprecated
Determines whether the given scope is currently active.
It does however not check if the scope actually exists.
at line line 30
reset()
Resets shared services from the container.
The container is not intended to be used again after being reset in a normal workflow. This method is meant as a way to release references for ref-counting. A subsequent call to ContainerInterface::get will recreate a new instance of the shared service.