DefinitionDecorator
class DefinitionDecorator extends Definition
This definition decorates another definition.
Methods
Constructor.
Sets a factory.
Sets the service that this service is decorating.
Sets the service class.
Sets the arguments to pass to the service constructor/factory method.
Adds an argument to pass to the service constructor/factory method.
You should always use this method when overwriting existing arguments of the parent definition.
Gets the arguments to pass to the service constructor/factory method.
Gets an argument to pass to the service constructor/factory method.
Sets the methods to call after service initialization.
Adds a method to call after service initialization.
Removes a method to call after service initialization.
Check if the current definition has a given method to call after service initialization.
Adds a tag for this definition.
Sets a file to require before creating the service.
Sets the visibility of this service.
Sets the lazy flag of this service.
Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
Whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
Whether this definition is abstract, that means it merely serves as a template for other definitions.
Whether this definition is abstract, that means it merely serves as a template for other definitions.
Whether this definition is deprecated, that means it should not be called anymore.
Whether this definition is deprecated, that means it should not be called anymore.
Message to use if this definition is deprecated.
Sets a configurator to call after the service is fully initialized.
Gets the configurator to call after the service is fully initialized.
Sets types that will default to this definition.
Gets autowiring types that will default to this definition.
Adds a type that will default to this definition.
Will this definition default for the given type?
Returns the Definition being decorated.
Returns all changes tracked for the Definition object.
Details
at line line 32
__construct(string $parent)
Constructor.
at line line 72
Definition
setFactory($callable)
Sets a factory.
in Definition at line line 79
string|array
getFactory()
Gets the factory.
at line line 122
Definition
setDecoratedService(null|string $id, null|string $renamedId = null, int $priority)
Sets the service that this service is decorating.
in Definition at line line 115
null|array
getDecoratedService()
Gets the service that decorates this service.
at line line 62
Definition
setClass(string $class)
Sets the service class.
in Definition at line line 139
string|null
getClass()
Gets the service class.
in Definition at line line 151
Definition
setArguments(array $arguments)
Sets the arguments to pass to the service constructor/factory method.
in Definition at line line 158
setProperties(array $properties)
in Definition at line line 165
getProperties()
in Definition at line line 170
setProperty($name, $value)
in Definition at line line 184
Definition
addArgument(mixed $argument)
Adds an argument to pass to the service constructor/factory method.
at line line 181
Definition
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.
in Definition at line line 217
array
getArguments()
Gets the arguments to pass to the service constructor/factory method.
at line line 151
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.
in Definition at line line 247
Definition
setMethodCalls(array $calls = array())
Sets the methods to call after service initialization.
in Definition at line line 267
Definition
addMethodCall(string $method, array $arguments = array())
Adds a method to call after service initialization.
in Definition at line line 284
Definition
removeMethodCall(string $method)
Removes a method to call after service initialization.
in Definition at line line 303
bool
hasMethodCall(string $method)
Check if the current definition has a given method to call after service initialization.
in Definition at line line 319
array
getMethodCalls()
Gets the methods to call after service initialization.
in Definition at line line 331
Definition
setTags(array $tags)
Sets tags for this definition.
in Definition at line line 343
array
getTags()
Returns all tags.
in Definition at line line 355
array
getTag(string $name)
Gets a tag by name.
in Definition at line line 368
Definition
addTag(string $name, array $attributes = array())
Adds a tag for this definition.
in Definition at line line 382
bool
hasTag(string $name)
Whether this definition has a tag with the given name.
in Definition at line line 394
Definition
clearTag(string $name)
Clears all tags for a given name.
in Definition at line line 406
Definition
clearTags()
Clears the tags for this definition.
at line line 92
Definition
setFile(string $file)
Sets a file to require before creating the service.
in Definition at line line 432
string|null
getFile()
Gets the file to require before creating the service.
in Definition at line line 444
Definition
setShared(bool $shared)
Sets if the service must be shared or not.
in Definition at line line 456
bool
isShared()
Whether this service is shared.
at line line 102
Definition
setPublic(bool $boolean)
Sets the visibility of this service.
in Definition at line line 480
bool
isPublic()
Whether this service is public facing.
at line line 112
Definition
setLazy($boolean)
Sets the lazy flag of this service.
in Definition at line line 504
bool
isLazy()
Whether this service is lazy.
in Definition at line line 517
Definition
setSynthetic(bool $boolean)
Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
in Definition at line line 530
bool
isSynthetic()
Whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
in Definition at line line 543
Definition
setAbstract(bool $boolean)
Whether this definition is abstract, that means it merely serves as a template for other definitions.
in Definition at line line 556
bool
isAbstract()
Whether this definition is abstract, that means it merely serves as a template for other definitions.
at line line 132
Definition
setDeprecated($boolean = true, string $template = null)
Whether this definition is deprecated, that means it should not be called anymore.
in Definition at line line 597
bool
isDeprecated()
Whether this definition is deprecated, that means it should not be called anymore.
in Definition at line line 609
string
getDeprecationMessage(string $id)
Message to use if this definition is deprecated.
at line line 82
Definition
setConfigurator(callable $callable)
Sets a configurator to call after the service is fully initialized.
in Definition at line line 633
callable|null
getConfigurator()
Gets the configurator to call after the service is fully initialized.
in Definition at line line 645
Definition
setAutowiringTypes(array $types)
Sets types that will default to this definition.
in Definition at line line 661
bool
isAutowired()
Is the definition autowired?
in Definition at line line 673
Definition
setAutowired($autowired)
Sets autowired.
in Definition at line line 685
string[]
getAutowiringTypes()
Gets autowiring types that will default to this definition.
in Definition at line line 697
Definition
addAutowiringType(string $type)
Adds a type that will default to this definition.
in Definition at line line 711
Definition
removeAutowiringType(string $type)
Removes a type.
in Definition at line line 725
bool
hasAutowiringType(string $type)
Will this definition default for the given type?
at line line 44
string
getParent()
Returns the Definition being decorated.
at line line 54
array
getChanges()
Returns all changes tracked for the Definition object.