Interface

Symfony\Component\DependencyInjection\TaggedContainerInterface

interface TaggedContainerInterface implements ContainerInterface

TaggedContainerInterface is the interface implemented when a container knows how to deals with tags.

Methods

set(string $id, object $service, string $scope = self::SCOPE_CONTAINER)

Sets a service.

from ContainerInterface
object get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)

Gets a service.

from ContainerInterface
Boolean has(string $id)

Returns true if the given service is defined.

from ContainerInterface
mixed getParameter(string $name)

Gets a parameter.

from ContainerInterface
Boolean hasParameter(string $name)

Checks if a parameter exists.

from ContainerInterface
setParameter(string $name, mixed $value)

Sets a parameter.

from ContainerInterface
enterScope(string $name)

Enters the given scope

from ContainerInterface
leaveScope(string $name)

Leaves the current scope, and re-enters the parent scope

from ContainerInterface
addScope(ScopeInterface $scope)

Adds a scope to the container

from ContainerInterface
Boolean hasScope(string $name)

Whether this container has the given scope

from ContainerInterface
Boolean isScopeActive(string $name)

Determines whether the given scope is currently active.

from ContainerInterface
array findTaggedServiceIds(string $name)

Returns service ids for a given tag.

Details

in ContainerInterface at line 42
public set(string $id, object $service, string $scope = self::SCOPE_CONTAINER)

Sets a service.

Parameters

string $id The service identifier
object $service The service instance
string $scope The scope of the service

in ContainerInterface at line 59
public object get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)

Gets a service.

Parameters

string $id The service identifier
int $invalidBehavior The behavior when the service does not exist

Return Value

object The associated service

Exceptions

ServiceCircularReferenceException When a circular reference is detected
ServiceNotFoundException When the service is not defined

See also

Reference

in ContainerInterface at line 70
public Boolean has(string $id)

Returns true if the given service is defined.

Parameters

string $id The service identifier

Return Value

Boolean true if the service is defined, false otherwise

in ContainerInterface at line 83
public mixed getParameter(string $name)

Gets a parameter.

Parameters

string $name The parameter name

Return Value

mixed The parameter value

Exceptions

InvalidArgumentException if the parameter is not defined

in ContainerInterface at line 94
public Boolean hasParameter(string $name)

Checks if a parameter exists.

Parameters

string $name The parameter name

Return Value

Boolean The presence of parameter in container

in ContainerInterface at line 104
public setParameter(string $name, mixed $value)

Sets a parameter.

Parameters

string $name The parameter name
mixed $value The parameter value

in ContainerInterface at line 113
public enterScope(string $name)

Enters the given scope

Parameters

string $name

in ContainerInterface at line 122
public leaveScope(string $name)

Leaves the current scope, and re-enters the parent scope

Parameters

string $name

in ContainerInterface at line 131
public addScope(ScopeInterface $scope)

Adds a scope to the container

Parameters

ScopeInterface $scope

in ContainerInterface at line 142
public Boolean hasScope(string $name)

Whether this container has the given scope

Parameters

string $name

Return Value

Boolean

in ContainerInterface at line 155
public Boolean isScopeActive(string $name)

Determines whether the given scope is currently active.

It does however not check if the scope actually exists.

Parameters

string $name

Return Value

Boolean

at line 32
public array findTaggedServiceIds(string $name)

Returns service ids for a given tag.

Parameters

string $name The tag name

Return Value

array An array of tags