class DefinitionDecorator extends Definition

This definition decorates another definition.

Properties

protected $arguments from Definition

Methods

__construct(string $parent)

No description

$this
setFactory($callable)

Sets a factory.

string|array|null
getFactory()

Gets the factory.

$this
setFactoryClass($class)

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

string|null
getFactoryClass($triggerDeprecationError = true) deprecated

Gets the factory class.

$this
setFactoryMethod($method)

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

$this
setDecoratedService(string|null $id, string|null $renamedId = null, int $priority = 0)

Sets the service that this service is decorating.

array|null
getDecoratedService()

Gets the service that this service is decorating.

string|null
getFactoryMethod($triggerDeprecationError = true) deprecated

Gets the factory method.

$this
setFactoryService($service, $triggerDeprecationError = true)

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

string|null
getFactoryService($triggerDeprecationError = true) deprecated

Gets the factory service id.

$this
setClass(string $class)

Sets the service class.

string|null
getClass()

Gets the service class.

$this
setArguments(array $arguments)

Sets the arguments to pass to the service constructor/factory method.

$this
setProperties(array $properties)

Sets the properties to define when creating the service.

array
getProperties()

Gets the properties to define when creating the service.

$this
setProperty(string $name, mixed $value)

Sets a specific property.

$this
addArgument(mixed $argument)

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

$this
replaceArgument(int $index, mixed $value)

You should always use this method when overwriting existing arguments of the parent definition.

array
getArguments()

Gets the arguments to pass to the service constructor/factory method.

mixed
getArgument(int $index)

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

$this
setMethodCalls(array $calls = array())

Sets the methods to call after service initialization.

$this
addMethodCall(string $method, array $arguments = array())

Adds a method to call after service initialization.

$this
removeMethodCall(string $method)

Removes a method to call after service initialization.

bool
hasMethodCall(string $method)

Check if the current definition has a given method to call after service initialization.

array
getMethodCalls()

Gets the methods to call after service initialization.

$this
setTags(array $tags)

Sets tags for this definition.

array
getTags()

Returns all tags.

array
getTag(string $name)

Gets a tag by name.

$this
addTag(string $name, array $attributes = array())

Adds a tag for this definition.

bool
hasTag(string $name)

Whether this definition has a tag with the given name.

$this
clearTag(string $name)

Clears all tags for a given name.

$this
clearTags()

Clears the tags for this definition.

$this
setFile(string $file)

Sets a file to require before creating the service.

string|null
getFile()

Gets the file to require before creating the service.

$this
setShared(bool $shared)

Sets if the service must be shared or not.

bool
isShared()

Whether this service is shared.

$this
setScope($scope, $triggerDeprecationError = true) deprecated

Sets the scope of the service.

string
getScope($triggerDeprecationError = true) deprecated

Returns the scope of the service.

$this
setPublic(bool $boolean)

Sets the visibility of this service.

bool
isPublic()

Whether this service is public facing.

$this
setSynchronized($boolean, $triggerDeprecationError = true) deprecated

Sets the synchronized flag of this service.

bool
isSynchronized($triggerDeprecationError = true) deprecated

Whether this service is synchronized.

$this
setLazy($boolean)

Sets the lazy flag of this service.

bool
isLazy()

Whether this service is lazy.

$this
setSynthetic(bool $boolean)

Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected.

bool
isSynthetic()

Whether this definition is synthetic, that is not constructed by the container, but dynamically injected.

$this
setAbstract(bool $boolean)

Whether this definition is abstract, that means it merely serves as a template for other definitions.

bool
isAbstract()

Whether this definition is abstract, that means it merely serves as a template for other definitions.

$this
setDeprecated($boolean = true, string $template = null)

Whether this definition is deprecated, that means it should not be called anymore.

bool
isDeprecated()

Whether this definition is deprecated, that means it should not be called anymore.

string
getDeprecationMessage(string $id)

Message to use if this definition is deprecated.

$this
setConfigurator(callable $callable)

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

callable|null
getConfigurator()

Gets the configurator to call after the service is fully initialized.

$this
setAutowiringTypes(array $types)

Sets types that will default to this definition.

bool
isAutowired()

Is the definition autowired?

$this
setAutowired(bool $autowired)

Enables/disables autowiring.

string[]
getAutowiringTypes()

Gets autowiring types that will default to this definition.

$this
addAutowiringType(string $type)

Adds a type that will default to this definition.

$this
removeAutowiringType(string $type)

Removes a type.

bool
hasAutowiringType(string $type)

Will this definition default for the given type?

string
getParent()

Returns the Definition being decorated.

array
getChanges()

Returns all changes tracked for the Definition object.

Details

at line 30
__construct(string $parent)

Parameters

string $parent The id of Definition instance to decorate

at line 70
$this setFactory($callable)

Sets a factory.

Parameters

$callable

Return Value

$this

in Definition at line 84
string|array|null getFactory()

Gets the factory.

Return Value

string|array|null The PHP function or an array containing a class/Reference and a method to call

at line 80
$this 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

$this

in Definition at line 115
string|null getFactoryClass($triggerDeprecationError = true) deprecated

deprecated since version 2.6, to be removed in 3.0.

Gets the factory class.

Parameters

$triggerDeprecationError

Return Value

string|null The factory class name

at line 90
$this setFactoryMethod($method)

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

Parameters

$method

Return Value

$this

at line 150
$this setDecoratedService(string|null $id, string|null $renamedId = null, int $priority = 0)

Sets the service that this service is decorating.

Parameters

string|null $id The decorated service id, use null to remove decoration
string|null $renamedId The new decorated service id
int $priority The priority of decoration

Return Value

$this

Exceptions

InvalidArgumentException in case the decorated service id and the new decorated service id are equals

in Definition at line 173
array|null getDecoratedService()

Gets the service that this service is decorating.

Return Value

array|null An array composed of the decorated service id, the new id for it and the priority of decoration, null if no service is decorated

in Definition at line 185
string|null getFactoryMethod($triggerDeprecationError = true) deprecated

deprecated since version 2.6, to be removed in 3.0.

Gets the factory method.

Parameters

$triggerDeprecationError

Return Value

string|null The factory method name

at line 100
$this setFactoryService($service, $triggerDeprecationError = true)

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

Parameters

$service
$triggerDeprecationError

Return Value

$this

in Definition at line 221
string|null getFactoryService($triggerDeprecationError = true) deprecated

deprecated since version 2.6, to be removed in 3.0.

Gets the factory service id.

Parameters

$triggerDeprecationError

Return Value

string|null The factory service id

at line 60
$this setClass(string $class)

Sets the service class.

Parameters

string $class The service class

Return Value

$this

in Definition at line 249
string|null getClass()

Gets the service class.

Return Value

string|null The service class

in Definition at line 259
$this setArguments(array $arguments)

Sets the arguments to pass to the service constructor/factory method.

Parameters

array $arguments

Return Value

$this

in Definition at line 271
$this setProperties(array $properties)

Sets the properties to define when creating the service.

Parameters

array $properties

Return Value

$this

in Definition at line 283
array getProperties()

Gets the properties to define when creating the service.

Return Value

array

in Definition at line 296
$this setProperty(string $name, mixed $value)

Sets a specific property.

Parameters

string $name
mixed $value

Return Value

$this

in Definition at line 310
$this addArgument(mixed $argument)

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

Parameters

mixed $argument An argument

Return Value

$this

at line 219
$this replaceArgument(int $index, mixed $value)

You should always use this method when overwriting existing arguments of the parent definition.

If you directly call setArguments() keep in mind that you must follow certain conventions when you want to overwrite the arguments of the parent definition, otherwise your arguments will only be appended.

Parameters

int $index
mixed $value

Return Value

$this

Exceptions

InvalidArgumentException when $index isn't an integer

in Definition at line 347
array getArguments()

Gets the arguments to pass to the service constructor/factory method.

Return Value

array The array of arguments

at line 189
mixed getArgument(int $index)

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

If replaceArgument() has been used to replace an argument, this method will return the replacement value.

Parameters

int $index

Return Value

mixed The argument value

Exceptions

OutOfBoundsException When the argument does not exist

in Definition at line 375
$this setMethodCalls(array $calls = array())

Sets the methods to call after service initialization.

Parameters

array $calls

Return Value

$this

in Definition at line 395
$this addMethodCall(string $method, array $arguments = array())

Adds a method to call after service initialization.

Parameters

string $method The method name to call
array $arguments An array of arguments to pass to the method call

Return Value

$this

Exceptions

InvalidArgumentException on empty $method param

in Definition at line 412
$this removeMethodCall(string $method)

Removes a method to call after service initialization.

Parameters

string $method The method name to remove

Return Value

$this

in Definition at line 431
bool hasMethodCall(string $method)

Check if the current definition has a given method to call after service initialization.

Parameters

string $method The method name to search for

Return Value

bool

in Definition at line 447
array getMethodCalls()

Gets the methods to call after service initialization.

Return Value

array An array of method calls

in Definition at line 457
$this setTags(array $tags)

Sets tags for this definition.

Parameters

array $tags

Return Value

$this

in Definition at line 469
array getTags()

Returns all tags.

Return Value

array An array of tags

in Definition at line 481
array getTag(string $name)

Gets a tag by name.

Parameters

string $name The tag name

Return Value

array An array of attributes

in Definition at line 494
$this addTag(string $name, array $attributes = array())

Adds a tag for this definition.

Parameters

string $name The tag name
array $attributes An array of attributes

Return Value

$this

in Definition at line 508
bool hasTag(string $name)

Whether this definition has a tag with the given name.

Parameters

string $name

Return Value

bool

in Definition at line 520
$this clearTag(string $name)

Clears all tags for a given name.

Parameters

string $name The tag name

Return Value

$this

in Definition at line 532
$this clearTags()

Clears the tags for this definition.

Return Value

$this

at line 120
$this setFile(string $file)

Sets a file to require before creating the service.

Parameters

string $file A full pathname to include

Return Value

$this

in Definition at line 558
string|null getFile()

Gets the file to require before creating the service.

Return Value

string|null The full pathname to include

in Definition at line 570
$this setShared(bool $shared)

Sets if the service must be shared or not.

Parameters

bool $shared Whether the service must be shared or not

Return Value

$this

in Definition at line 582
bool isShared()

Whether this service is shared.

Return Value

bool

in Definition at line 596
$this setScope($scope, $triggerDeprecationError = true) deprecated

deprecated since version 2.8, to be removed in 3.0.

Sets the scope of the service.

Parameters

$scope
$triggerDeprecationError

Return Value

$this

in Definition at line 618
string getScope($triggerDeprecationError = true) deprecated

deprecated since version 2.8, to be removed in 3.0.

Returns the scope of the service.

Parameters

$triggerDeprecationError

Return Value

string

at line 130
$this setPublic(bool $boolean)

Sets the visibility of this service.

Parameters

bool $boolean

Return Value

$this

in Definition at line 646
bool isPublic()

Whether this service is public facing.

Return Value

bool

in Definition at line 660
$this setSynchronized($boolean, $triggerDeprecationError = true) deprecated

deprecated since version 2.7, will be removed in 3.0.

Sets the synchronized flag of this service.

Parameters

$boolean
$triggerDeprecationError

Return Value

$this

in Definition at line 678
bool isSynchronized($triggerDeprecationError = true) deprecated

deprecated since version 2.7, will be removed in 3.0.

Whether this service is synchronized.

Parameters

$triggerDeprecationError

Return Value

bool

at line 140
$this setLazy($boolean)

Sets the lazy flag of this service.

Parameters

$boolean

Return Value

$this

in Definition at line 706
bool isLazy()

Whether this service is lazy.

Return Value

bool

in Definition at line 719
$this setSynthetic(bool $boolean)

Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected.

Parameters

bool $boolean

Return Value

$this

in Definition at line 732
bool isSynthetic()

Whether this definition is synthetic, that is not constructed by the container, but dynamically injected.

Return Value

bool

in Definition at line 745
$this setAbstract(bool $boolean)

Whether this definition is abstract, that means it merely serves as a template for other definitions.

Parameters

bool $boolean

Return Value

$this

in Definition at line 758
bool isAbstract()

Whether this definition is abstract, that means it merely serves as a template for other definitions.

Return Value

bool

at line 160
$this setDeprecated($boolean = true, string $template = null)

Whether this definition is deprecated, that means it should not be called anymore.

Parameters

$boolean
string $template Template message to use if the definition is deprecated

Return Value

$this

Exceptions

InvalidArgumentException when the message template is invalid

in Definition at line 799
bool isDeprecated()

Whether this definition is deprecated, that means it should not be called anymore.

Return Value

bool

in Definition at line 811
string getDeprecationMessage(string $id)

Message to use if this definition is deprecated.

Parameters

string $id Service id relying on this definition

Return Value

string

at line 110
$this setConfigurator(callable $callable)

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

Parameters

callable $callable A PHP callable

Return Value

$this

in Definition at line 835
callable|null getConfigurator()

Gets the configurator to call after the service is fully initialized.

Return Value

callable|null The PHP callable to call

in Definition at line 847
$this setAutowiringTypes(array $types)

Sets types that will default to this definition.

Parameters

array $types

Return Value

$this

in Definition at line 863
bool isAutowired()

Is the definition autowired?

Return Value

bool

at line 170
$this setAutowired(bool $autowired)

Enables/disables autowiring.

Parameters

bool $autowired

Return Value

$this

in Definition at line 887
string[] getAutowiringTypes()

Gets autowiring types that will default to this definition.

Return Value

string[]

in Definition at line 899
$this addAutowiringType(string $type)

Adds a type that will default to this definition.

Parameters

string $type

Return Value

$this

in Definition at line 913
$this removeAutowiringType(string $type)

Removes a type.

Parameters

string $type

Return Value

$this

in Definition at line 927
bool hasAutowiringType(string $type)

Will this definition default for the given type?

Parameters

string $type

Return Value

bool

at line 42
string getParent()

Returns the Definition being decorated.

Return Value

string

at line 52
array getChanges()

Returns all changes tracked for the Definition object.

Return Value

array An array of changes for this Definition