Trouble with importing annotations

前端 未结 6 1780
闹比i
闹比i 2021-01-11 15:14

I\'m working on a CodeIgniter project in which I\'m using Doctrine2 and the Symfony2 Validator component.

All my Doctrine2 entities use Doctrine\\ORM\\Mapping

6条回答
  •  天命终不由人
    2021-01-11 15:58

    I had a similar issue when using Silex, Doctrine2 and the Symfony-Validator.

    The solution was to avoid using the SimpleAnnotationsReader and instead using the normal AnnotationReader (have a look at Doctrine\ORM\Configuration::newDefaultAnnotationDriver). You can then preface every entity with ORM\ (and of course inserting use Doctrine\ORM\Mapping as ORM; in every entity).

提交回复
热议问题