Definition represents a service definition.
- author Fabien Potencier
Properties |
public ?int $decorationOnInvalid = NULL
|
public ?string $innerServiceId = NULL
|
Methods |
public __construct(?string $class = NULL, array $arguments = []) |
public addArgument(?mixed $argument) : static Adds an argument to pass to the service constructor/factory method.
|
public addError(Closure|self|string $error) : static Add an error that occurred when building this Definition.
|
public addMethodCall(string $method, array $arguments = [], bool $returnsClone = false) : static Adds a method to call after service initialization.
|
public addTag(string $name, array $attributes = []) : static Adds a tag for this definition.
|
public clearTag(string $name) : static Clears all tags for a given name.
|
public clearTags() : static Clears the tags for this definition.
|
public getArgument(string|int $index) : ?mixed Gets an argument to pass to the service constructor/factory method.
|
public getArguments() : array Gets the arguments to pass to the service constructor/factory method. |
public getBindings() : array Gets bindings.
|
public getChanges() : array Returns all changes tracked for the Definition object. |
public getClass() : ?string Gets the service class. |
public getConfigurator() : array|string|?null Gets the configurator to call after the service is fully initialized. |
public getDecoratedService() : ?array Gets the service that this service is decorating.
|
public getDeprecation(string $id) : array
|
public getErrors() : array Returns any errors that occurred while building this Definition. |
public getFactory() : array|string|?null Gets the factory.
|
public getFile() : ?string Gets the file to require before creating the service. |
public getInstanceofConditionals() : array Gets the definition templates to conditionally apply on the current definition, keyed by parent interface/class.
|
public getMethodCalls() : array Gets the methods to call after service initialization. |
public getProperties() : array Gets the properties to define when creating the service. |
public getTag(string $name) : array Gets a tag by name. |
public getTags() : array Returns all tags. |
public hasErrors() : bool |
public hasMethodCall(string $method) : bool Check if the current definition has a given method to call after service initialization. |
public hasTag(string $name) : bool Whether this definition has a tag with the given name. |
public isAbstract() : bool Whether this definition is abstract, that means it merely serves as a template for other definitions. |
public isAutoconfigured() : bool |
public isAutowired() : bool Is the definition autowired? |
public isDeprecated() : bool Whether this definition is deprecated, that means it should not be called anymore. |
public isLazy() : bool Whether this service is lazy. |
public isPrivate() : bool Whether this service is private. |
public isPublic() : bool Whether this service is public facing. |
public isShared() : bool Whether this service is shared. |
public isSynthetic() : bool Whether this definition is synthetic, that is not constructed by the container, but dynamically injected. |
public removeMethodCall(string $method) : static Removes a method to call after service initialization.
|
public replaceArgument(string|int $index, ?mixed $argument) : static Replaces a specific argument.
|
public setAbstract(bool $boolean) : static Whether this definition is abstract, that means it merely serves as a template for other definitions.
|
public setArgument(string|int $key, ?mixed $value) : static Sets a specific argument.
|
public setArguments(array $arguments) : static Sets the arguments to pass to the service constructor/factory method.
|
public setAutoconfigured(bool $autoconfigured) : static Sets whether or not instanceof conditionals should be prepended with a global set.
|
public setAutowired(bool $autowired) : static Enables/disables autowiring.
|
public setBindings(array $bindings) : static Sets bindings. Bindings map $named or FQCN arguments to values that should be injected in the matching parameters (of the constructor, of methods called and of controller actions).
|
public setChanges(array $changes) : static Sets the tracked changes for the Definition object.
|
public setClass(?string $class) : static Sets the service class.
|
public setConfigurator(Symfony Sets a configurator to call after the service is fully initialized.
|
public setDecoratedService(?string $id, ?string $renamedId = NULL, int $priority = 0, int $invalidBehavior = 1Symfony\Component\DependencyInjection\ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) : static Sets the service that this service is decorating.
|
public setDeprecated(string $package, string $version, string $message) : static Whether this definition is deprecated, that means it should not be called anymore.
|
public setFactory(Symfony Sets a factory.
|
public setFile(?string $file) : static Sets a file to require before creating the service.
|
public setInstanceofConditionals(array $instanceof) : static Sets the definition templates to conditionally apply on the current definition, keyed by parent interface/class.
|
public setLazy(bool $lazy) : static Sets the lazy flag of this service.
|
public setMethodCalls(array $calls = []) : static Sets the methods to call after service initialization.
|
public setProperties(array $properties) : static Sets the properties to define when creating the service.
|
public setProperty(string $name, ?mixed $value) : static Sets a specific property.
|
public setPublic(bool $boolean) : static Sets the visibility of this service.
|
public setShared(bool $shared) : static Sets if the service must be shared or not.
|
public setSynthetic(bool $boolean) : static Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
|
public setTags(array $tags) : static Sets tags for this definition.
|
Properties |
protected array $arguments = [] |
Constants |
private Symfony |
Properties |
private bool $abstract = false |
private bool $autoconfigured = false |
private bool $autowired = false |
private array $bindings = [] |
private array $calls = [] |
private array $changes = [] |
private ?string $class = NULL |
private array|string|?null $configurator = NULL |
private ?array $decoratedService = NULL |
private array $deprecation = [] |
private array $errors = [] |
private array|string|?null $factory = NULL |
private ?string $file = NULL |
private array $instanceof = [] |
private bool $lazy = false |
private array $properties = [] |
private bool $public = false |
private bool $shared = true |
private bool $synthetic = false |
private array $tags = [] |