Search code examples
doctrineslim-4

Doctrine annotations for migrations and ORM


I'm trying to setup a project using Slim and Doctrine. My problem is with the annotations.

If I try to run diff from migrations, it requires the annotations from my entities to be like this:

enter image description here

But, if I try to persist my objects in PHP ORM, it requires the annotation to be like this: enter image description here

I'm not beeing able to find a way to configure doctrine to work with just one type of annotation


Solution

  • I fixed this by when creating the Annotation Configuration for my EntityManager, set it to use the simple annotation reader, which is the last parameter here:

    enter image description here