laravel-doctrine / extensions

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

Bug when using XML bindings with extensions? #21

Closed laurentvd closed 8 years ago

laurentvd commented 8 years ago

First; great work on the whole Doctrine for Laravel suite. Really like it. I'm not sure if this is an laravel-doctrine/extensions or laravel-doctrine/orm issue, but when I switch to xml metadata, I get the following error:

[Doctrine\Common\Annotations\AnnotationException]                                                                                                                            
  [Semantical Error] The annotation "@Doctrine\ORM\Mapping\MappedSuperclass" in class Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation does not exist,   
  or could not be auto-loaded. 

Let me know if you can reproduce the error with this information. If I remove the LaravelDoctrine\Extensions\GedmoExtensionsServiceProvider::class from my app.php or switch back to annotations, the error is gone.

laurentvd commented 8 years ago

Any news on this? Is there any way I can help debug this issue?

patrickbrouwers commented 8 years ago

Hey sorry for the late response.

Quote from the docs:

If you are using an annotation driver, then add the Gedmo (Behavioral) extensions service provider in config/app.php:

LaravelDoctrine\Extensions\GedmoExtensionsServiceProvider::class,

So yes, it's logical you are getting that error when using XML driver. Remove the GedmoSP and you'll be good to go.

laurentvd commented 8 years ago

Whoops, sorry, my bad. I thought I did read the docs carefully, but clearly I overlooked something :) Oddly enough, I didn't check to see if the extensions still worked. I just assumed I needed the service provider for the extensions to work. Anyway, thanks!