Definition
class Definition
Definition represents a service definition.
Properties
protected | $arguments | ||
$innerServiceId |
Methods
No description
Returns all changes tracked for the Definition object.
Sets the tracked changes for the Definition object.
Sets a factory.
Gets the factory.
Sets the service that this service is decorating.
Gets the service that this service is decorating.
Sets the service class.
Gets the service class.
Sets the arguments to pass to the service constructor/factory method.
Sets the properties to define when creating the service.
Gets the properties to define when creating the service.
Sets a specific property.
Adds an argument to pass to the service constructor/factory method.
Replaces a specific argument.
Sets a specific argument.
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.
Gets the methods to call after service initialization.
Sets the definition templates to conditionally apply on the current definition, keyed by parent interface/class.
Gets the definition templates to conditionally apply on the current definition, keyed by parent interface/class.
Sets whether or not instanceof conditionals should be prepended with a global set.
No description
Sets tags for this definition.
Returns all tags.
Gets a tag by name.
Adds a tag for this definition.
Whether this definition has a tag with the given name.
Clears all tags for a given name.
Clears the tags for this definition.
Sets a file to require before creating the service.
Gets the file to require before creating the service.
Sets if the service must be shared or not.
Whether this service is shared.
Sets the visibility of this service.
Whether this service is public facing.
Sets if this service is private.
Whether this service is private.
Sets the lazy flag of this service.
Whether this service is lazy.
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.
Is the definition autowired?
Enables/disables autowiring.
Gets bindings.
Sets bindings.
Add an error that occurred when building this Definition.
Returns any errors that occurred while building this Definition.
Details
$this
setDecoratedService(string|null $id, string|null $renamedId = null, int $priority = 0)
Sets the service that this service is decorating.
$this
setArguments(array $arguments)
Sets the arguments to pass to the service constructor/factory method.
$this
addArgument(mixed $argument)
Adds an argument to pass to the service constructor/factory method.
mixed
getArgument(int|string $index)
Gets an argument to pass to the service constructor/factory method.
$this
addMethodCall(string $method, array $arguments = array())
Adds 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.
$this
setInstanceofConditionals(array $instanceof)
Sets the definition templates to conditionally apply on the current definition, keyed by parent interface/class.
ChildDefinition[]
getInstanceofConditionals()
Gets the definition templates to conditionally apply on the current definition, keyed by parent interface/class.
$this
setAutoconfigured(bool $autoconfigured)
Sets whether or not instanceof conditionals should be prepended with a global set.
$this
setPrivate(bool $boolean)
Sets if this service is private.
When set, the "private" state has a higher precedence than "public". In version 3.4, a "private" service always remains publicly accessible, but triggers a deprecation notice when accessed from the container, so that the service can be made really private in 4.0.
$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(bool $status = 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.
$this
setConfigurator(string|array $configurator)
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.