1

I have a project that uses Doctrine 2.0, works rather well. I tried to upgrade to 2.2.2, however I have noticed several differences:

/** * Entities\Log * * @ORM\Table(name="log") * @ORM\Entity(repositoryClass="Repositories\LogRepository") */

Is how it is shown in 2.2.2.

But this is how it is shown in 2.0.x:

/** * Entities\Log * * @Table(name="log") * @Entity(repositoryClass="Repositories\LogRepository") */

If I convert the 2.2.2, to look like 2.0, everything is fine, it loads up, and there is a copy of the object in cache. However, when I leave it alone I get this error:

Application Path: /www/sites/diracianbilling-repository/trunk/application
Fatal error: Uncaught exception 'Doctrine\ORM\Mapping\MappingException' with message 'Class Entities\Log is not a valid entity or mapped super class.' in /usr/share/php/Doctrine/ORM/Mapping/MappingException.php:147 Stack trace:

NiteRain
  • 663
  • 8
  • 14

1 Answers1

1

I guess that you generated your entities from the database.

Doctrine 2.2.2 for some reason generates these annotations that itself cannot parse. This is obviously a bug.

As a workaround you can configure the generator to provide 2.0-style annotations. Use the solution from dminer and add the following line just before generating:

$generator->setAnnotationPrefix("");
Community
  • 1
  • 1
Francois Bourgeois
  • 3,650
  • 5
  • 30
  • 41