Open RodriAndreotti opened 3 years ago
OK, I think I managed to solve the problem. I'll leave it registered in case someone else finds the same case as mine:
A little bit of context, as the doctrine/cache drivers are obsolete and have been removed from version 2 of the package, I had to create a new "fake" driver in order to get psr-container-doctrine
to work properly, done that my code started to show the above errors, after much debugging in the doctrine's internal codes, I decided to take a look at DriverFactory
's
psr-container-doctrine
, and that's when I noticed the problem, it calls the AnnotationDriver inside a CachedDriver, my cache driver was without any implementation, so it didn't return anything and therefore the AnnotationDriver
wasn't called.
What I did for the AnnotationDriver
to be called was to recreate an implementation of the doctrine/cache
ArrayDriver
, for the development environment should be enough for now, then I think about another implementation with a better engine.
When I recreated the ArrayDriver
implementation, my code started to recognize the entities correctly.
As mentioned in the issue below, I think it would be very useful to be able to disable the cache mechanism through the settings. https://github.com/Roave/psr-container-doctrine/issues/46
Hello, there! I'm struggling for 3 days to configure the roave/psr-container-doctrine with mezzio.
First I struggled with caches, then with MappingDriver, now I managed to make it all work, but it doesn't recognize entities. This is my exception:
Also (but less important) when I try to validate the schema on cli it tells me that the enum type is not supported.
Could someone give me some help?
My actual
doctrine.global.config
:Relevant part of
ConfigProvider.php
:If anyone can help me figure out where I'm going wrong I'll be very grateful. I use a configuration very similar to this one in another API with Zend Expressive and with the DASPRiD/container-interop-doctrine plugin, and there it works perfectly.
But here I haven't been able to find the way yet.
Thanks in advance.