laravel-doctrine / extensions

Extensions integration for Doctrine2 and Laravel
http://laraveldoctrine.org/
MIT License
48 stars 24 forks source link

Event "doctrine.extensions.booting" never happens in ServiceProvider #25

Closed JoseClaudioADS closed 8 years ago

JoseClaudioADS commented 8 years ago

Was error loading the annotations of Gedmo.

I investigated and saw that there was an event in ServiceProvider ("$ this-> app [ 'events'] -> listen ('doctrine.extensions.booting.'"), Which never happened not even found a reference to the event.

I removed that line and functioned normally. That was right?

patrickbrouwers commented 8 years ago

The event is fired in DoctrineServiceProvider and it's important that the listener stays in place.

Make sure the DoctrineServiceProvider is registered before the GedmoServiceProvider.

Also try and avoid calling any registry/em related stuff in other ServiceProvider (like Auth::user() e.g.). It will boot the entity manager when it's not necessary.

JoseClaudioADS commented 8 years ago

@patrickbrouwers Actually it is called there. I believe you can be what you talked about calling EntityManager as Auth :: before.

I know I'm carrying him after Doctrine. And I believe that the Doctrine is being loaded after the ServicesProviders Laravel standards.

Once again the work will test and I submit the answers here. Thank you!

JoseClaudioADS commented 8 years ago

Really. I was calling a service before. Shot and fall. Thank you!