Copied!

Autowires a locator of services based on a tag name.

  • deprecated since Symfony 7.1, use {@see \AutowireLocator} instead.
  • attribute Attribute ( 32)
CloneableInstantiable
Properties
public ?string $defaultIndexMethod
public ?string $defaultPriorityMethod
public array|string $exclude
public bool $excludeSelf
public ?string $indexAttribute
public readonly array|bool Symfony\Component\DependencyInjection\Attribute\Autowire::$lazy
public string $tag
public readonly Symfony\Component\ExpressionLanguage\Expression|Symfony\Component\DependencyInjection\Reference|Symfony\Component\DependencyInjection\Argument\ArgumentInterface|array|string|?null Symfony\Component\DependencyInjection\Attribute\Autowire::$value
Methods
public __construct(string $tag, ?string $indexAttribute = NULL, ?string $defaultIndexMethod = NULL, ?string $defaultPriorityMethod = NULL, array|string $exclude = [], bool $excludeSelf = true)
 
  • param string $tag The tag to look for to populate the locator
  • param string|null $indexAttribute The name of the attribute that defines the key referencing each service in the tagged collection
  • param string|null $defaultIndexMethod The static method that should be called to get each service's key when their tag doesn't define the previous attribute
  • param string|null $defaultPriorityMethod The static method that should be called to get each service's priority when their tag doesn't define the "priority" attribute
  • param string|string[] $exclude A service id or a list of service ids to exclude
  • param bool $excludeSelf Whether to automatically exclude the referencing service from the locator
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration