Symfony2 API
Class

Symfony\Component\DependencyInjection\Reference

class Reference

Reference represents a service reference.

Methods

__construct(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, Boolean $strict = true)

Constructor.

string __toString()

__toString.

int getInvalidBehavior()

Returns the behavior to be used when the service does not exist.

Boolean isStrict()

Returns true when this Reference is strict

Details

at line 36
public __construct(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, Boolean $strict = true)

Constructor.

Parameters

string $id The service identifier
int $invalidBehavior The behavior when the service does not exist
Boolean $strict Sets how this reference is validated

See also

Container

at line 48
public string __toString()

__toString.

Return Value

string The service identifier

at line 58
public int getInvalidBehavior()

Returns the behavior to be used when the service does not exist.

Return Value

int

at line 68
public Boolean isStrict()

Returns true when this Reference is strict

Return Value

Boolean