interface ResettableContainerInterface implements ContainerInterface
ResettableContainerInterface defines additional resetting functionality for containers, allowing to release shared services when the container is not needed anymore.
set(string $id, object $service) Sets a service. | from ContainerInterface | |
object | get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) Gets a service. | from ContainerInterface |
bool | has(string $id) Returns true if the given service is defined. | from ContainerInterface |
bool | initialized(string $id) Check for whether or not a service has been initialized. | from ContainerInterface |
mixed | getParameter(string $name) Gets a parameter. | from ContainerInterface |
bool | hasParameter(string $name) Checks if a parameter exists. | from ContainerInterface |
setParameter(string $name, mixed $value) Sets a parameter. | from ContainerInterface | |
reset() Resets shared services from the container. |
Sets a service.
string | $id | The service identifier |
object | $service | The service instance |
Gets a service.
string | $id | The service identifier |
int | $invalidBehavior | The behavior when the service does not exist |
object | The associated service |
ServiceCircularReferenceException | When a circular reference is detected |
ServiceNotFoundException | When the service is not defined |
Reference |
Returns true if the given service is defined.
string | $id | The service identifier |
bool | true if the service is defined, false otherwise |
Check for whether or not a service has been initialized.
string | $id |
bool | true if the service has been initialized, false otherwise |
Gets a parameter.
string | $name | The parameter name |
mixed | The parameter value |
InvalidArgumentException | if the parameter is not defined |
Checks if a parameter exists.
string | $name | The parameter name |
bool | The presence of parameter in container |
Sets a parameter.
string | $name | The parameter name |
mixed | $value | The parameter value |
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.
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/DependencyInjection/ResettableContainerInterface.html