Skip to content
Advertisement

XXX is not a valid entity or mapped super class // and config options

I just started to use Doctrine2 and I have an error when I want to persist an entity. Here is my error: ‘Class “Myappappentityuser” is not a valid entity or mapped super class.’

eAccelerator is not installed on my computer.

My app (I don’t use Symfony) structure is like that:

  • MyApp
    • app
      • entity
    • core
      • external
        • Doctrine

And I initialize Doctrine with:

JavaScript

What is wrong with these lines ?

Also as I autoload my classes with an autoloader, is it necessary to use the Doctrine class loader ? If yes, are these lines correct ?

JavaScript

Edit: I forgot to add an entity class

use DoctrineORMMapping as ORM;

JavaScript

Advertisement

Answer

Ok, so my entity was correct and I don’t need to call classLoader.

below is the correct initialization:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement