Im using Doctrine with Zend Framework 3 which all goes without any problems. However at this point i am building a new library, a library that is not aware about ZF3 however it needs to talk with my DB. I was thinking to inject the entityManager into the repository of the library on which it can easily re-use the existing connections and such.
The problem with this however is that you can't use the entity configured in the library since the path is not configured on load. Is there a way to set this on runtime? Reason why is that i don't want to lock in the library into the framework.
The class 'Domain\Cron\Infrastructure\Repositories\Doctrine\CronEntity' was not found in the chain configured namespaces
I figured out that all the entities are here: $entityManager->getConfiguration()->getMetadataDriverImpl()->getAllClassNames()
However i am afraid that this is not possible on which i need to keep the repository in my Framework itself and inject it.
Any tips would be welcome