diff --git a/Manager/IndexManagerRegistry.php b/Manager/IndexManagerRegistry.php index 74dfe8d..1098a7e 100644 --- a/Manager/IndexManagerRegistry.php +++ b/Manager/IndexManagerRegistry.php @@ -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); + } + } }