Skip to content

Commit 521e226

Browse files
committed
Added IndexManagerRegistry::getAll() generator
1 parent 4a474f4 commit 521e226

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Manager/IndexManagerRegistry.php

+13
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,17 @@ public function getByEntity(DocumentInterface $entity)
6868

6969
return $this->get($indexManagerName);
7070
}
71+
72+
/**
73+
* Get all index manager instances defined
74+
*
75+
* @return \Generator|IndexManager[]
76+
*/
77+
public function getAll() : \Generator
78+
{
79+
$indexManagerNames = $this->metadataCollector->getIndexManagersForDocumentClasses();
80+
foreach ($indexManagerNames as $indexManagerName) {
81+
yield $this->get($indexManagerName);
82+
}
83+
}
7184
}

0 commit comments

Comments
 (0)