Symfony2 API
Class

Symfony\Component\DependencyInjection\DefinitionDecorator

class DefinitionDecorator extends Definition

This definition decorates another definition.

Methods

__construct(string $parent)

Constructor.

string getParent()

Returns the Definition being decorated.

array getChanges()

Returns all changes tracked for the Definition object.

Definition setClass(string $class)

Sets the service class.

Definition setFactoryClass($class)

Sets the name of the class that acts as a factory using the factory method, which will be invoked statically.

Definition setFactoryMethod($method)

Sets the factory method able to create an instance of this class.

Definition setFactoryService($service)

Sets the name of the service that acts as a factory using the factory method.

Definition setConfigurator(callable $callable)

Sets a configurator to call after the service is fully initialized.

Definition setFile(string $file)

Sets a file to require before creating the service.

Definition setPublic(Boolean $boolean)

Sets the visibility of this service.

mixed getArgument(integer $index)

Gets an argument to pass to the service constructor/factory method.

DefinitionDecorator replaceArgument(integer $index, mixed $value)

Sets a specific argument

Details

at line 36
public __construct(string $parent)

Constructor.

Parameters

string $parent The id of Definition instance to decorate.

at line 51
public string getParent()

Returns the Definition being decorated.

Return Value

string

at line 63
public array getChanges()

Returns all changes tracked for the Definition object.

Return Value

array An array of changes for this Definition

at line 73
public Definition setClass(string $class)

Sets the service class.

Parameters

string $class The service class

Return Value

Definition The current instance

at line 85
public Definition setFactoryClass($class)

Sets the name of the class that acts as a factory using the factory method, which will be invoked statically.

Parameters

$class

Return Value

Definition The current instance

at line 97
public Definition setFactoryMethod($method)

Sets the factory method able to create an instance of this class.

Parameters

$method

Return Value

Definition The current instance

at line 109
public Definition setFactoryService($service)

Sets the name of the service that acts as a factory using the factory method.

Parameters

$service

Return Value

Definition The current instance

at line 121
public Definition setConfigurator(callable $callable)

Sets a configurator to call after the service is fully initialized.

Parameters

callable $callable A PHP callable

Return Value

Definition The current instance

at line 133
public Definition setFile(string $file)

Sets a file to require before creating the service.

Parameters

string $file A full pathname to include

Return Value

Definition The current instance

at line 145
public Definition setPublic(Boolean $boolean)

Sets the visibility of this service.

Parameters

Boolean $boolean

Return Value

Definition The current instance

at line 166
public mixed getArgument(integer $index)

Gets an argument to pass to the service constructor/factory method.

Parameters

integer $index

Return Value

mixed The argument value

Exceptions

OutOfBoundsException When the argument does not exist

at line 197
public DefinitionDecorator replaceArgument(integer $index, mixed $value)

Sets a specific argument

Parameters

integer $index
mixed $value

Return Value

DefinitionDecorator the current instance

Exceptions

OutOfBoundsException When the replaced argument does not exist