0

Is there a good way to iterate all entity classes (across different modules) in Zend Framwork 2?

I already tried to go by Doctrine's EntityManager:

$entityManager->getMetadataFactory()->getLoadedMetadata();

but that does only return an empty array.

I know that one could probably do this by iterating all Classes in specific Namespaces, but that seems like a lot of overhead.

Is there maybe some way that I am missing?

vlz
  • 911
  • 1
  • 10
  • 18
  • 1
    What did you try, what went wrong, etc etc? I literally ran a search "doctrine get all entity classes" and got [this](https://stackoverflow.com/questions/15031534/get-array-list-of-entities-from-doctrine) as the first hit. (Note: linked answer uses `getAllMetadata()` instead of `getLoadedMetadata()`) – rkeet Jan 15 '19 at 16:05
  • Thank you, @rkeet, this was a stupid mistake on my part. I meant to change it back tou `getAllMetadata()` but didn't. Very embarassing. – vlz Jan 15 '19 at 16:19

0 Answers0