You are here

public function Target::getIndexer in Drupal 7 to 8/9 Module Upgrader 8

Returns an indexer for this target.

Parameters

string $which: The type of indexer to get. Should be the ID of an indexer plugin.

Return value

IndexerInterface

Overrides TargetInterface::getIndexer

File

src/Target.php, line 141

Class

Target
Default implementation of TargetInterface.

Namespace

Drupal\drupalmoduleupgrader

Code

public function getIndexer($which) {
  if (empty($this->indexers[$which])) {

    /** @var IndexerInterface $indexer */
    $indexer = $this->indexerManager
      ->createInstance($which);
    $indexer
      ->bind($this);
    $this->indexers[$which] = $indexer;
  }
  return $this->indexers[$which];
}