Skip to content

Commit

Permalink
Added IndexManagerRegistry::getAll() generator
Browse files Browse the repository at this point in the history
  • Loading branch information
pmishev committed Jul 10, 2019
1 parent 4a474f4 commit 521e226
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Manager/IndexManagerRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,17 @@ public function getByEntity(DocumentInterface $entity)

return $this->get($indexManagerName);
}

/**
* Get all index manager instances defined
*
* @return \Generator|IndexManager[]
*/
public function getAll() : \Generator
{
$indexManagerNames = $this->metadataCollector->getIndexManagersForDocumentClasses();
foreach ($indexManagerNames as $indexManagerName) {
yield $this->get($indexManagerName);
}
}
}

0 comments on commit 521e226

Please sign in to comment.