interface ContainerInterface implements ContainerInterface
ContainerInterface is the interface implemented by service container classes.
| RUNTIME_EXCEPTION_ON_INVALID_REFERENCE | |
| EXCEPTION_ON_INVALID_REFERENCE | |
| NULL_ON_INVALID_REFERENCE | |
| IGNORE_ON_INVALID_REFERENCE | |
| IGNORE_ON_UNINITIALIZED_REFERENCE |
| set(string $id, object $service) Sets a service. | ||
| object | get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) Gets a service. | |
| bool | has(string $id) Returns true if the given service is defined. | |
| bool | initialized(string $id) Check for whether or not a service has been initialized. | |
| mixed | getParameter(string $name) Gets a parameter. | |
| bool | hasParameter(string $name) Checks if a parameter exists. | |
| setParameter(string $name, mixed $value) Sets a parameter. |
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 |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/DependencyInjection/ContainerInterface.html