interface ContainerInterface
ContainerInterface is the interface implemented by service container classes.
EXCEPTION_ON_INVALID_REFERENCE | |
NULL_ON_INVALID_REFERENCE | |
IGNORE_ON_INVALID_REFERENCE | |
SCOPE_CONTAINER | |
SCOPE_PROTOTYPE |
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. | |
bool | has(string $id) Returns true if the given service is defined. | |
mixed | getParameter(string $name) Gets a parameter. | |
bool | 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. | ||
bool | hasScope(string $name) Whether this container has the given scope. | |
bool | isScopeActive(string $name) Determines whether the given scope is currently active. |
Sets a service.
Note: The $scope parameter is deprecated since version 2.8 and will be removed in 3.0.
Gets a service.
Returns true if the given service is defined.
Gets a parameter.
Checks if a parameter exists.
Sets a parameter.
Enters the given scope.
Leaves the current scope, and re-enters the parent scope.
Adds a scope to the container.
Whether this container has the given scope.
Determines whether the given scope is currently active.
It does however not check if the scope actually exists.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.8/Symfony/Component/DependencyInjection/ContainerInterface.html