Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AutowireIterator.php

class AutowireIterator

Autowires an iterator of services based on a tag name.

Hierarchy

  • class \Symfony\Component\DependencyInjection\Attribute\Autowire
    • class \Symfony\Component\DependencyInjection\Attribute\AutowireIterator extends \Symfony\Component\DependencyInjection\Attribute\Autowire

Expanded class hierarchy of AutowireIterator

3 files declare their use of AutowireIterator
CachedDiscoveryClearer.php in core/lib/Drupal/Core/Plugin/CachedDiscoveryClearer.php
ConfigImportSubscriber.php in core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php
ModuleInstaller.php in core/lib/Drupal/Core/Extension/ModuleInstaller.php

File

vendor/symfony/dependency-injection/Attribute/AutowireIterator.php, line 19

Namespace

Symfony\Component\DependencyInjection\Attribute
View source
class AutowireIterator extends Autowire {
    
    /**
     * @see ServiceSubscriberInterface::getSubscribedServices()
     *
     * @param string               $tag                   A tag name to search for to populate the iterator
     * @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|array<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 iterator
     */
    public function __construct(string $tag, ?string $indexAttribute = null, ?string $defaultIndexMethod = null, ?string $defaultPriorityMethod = null, string|array $exclude = [], bool $excludeSelf = true) {
        parent::__construct(new TaggedIteratorArgument($tag, $indexAttribute, $defaultIndexMethod, false, $defaultPriorityMethod, (array) $exclude, $excludeSelf));
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
Autowire::$lazy public property
Autowire::$value public property
AutowireIterator::__construct public function Overrides Autowire::__construct 1

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal