Trouble with importing annotations

前端 未结 6 1790
闹比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 16:14

    Add use statements for every annotation you have used in your entities. for example:

    use Doctrine\ORM\Mapping\Entity;
    use Doctrine\ORM\Mapping\Table;
    use Doctrine\ORM\Mapping\Id;
    use Doctrine\ORM\Mapping\Column;
    use Doctrine\ORM\Mapping\GeneratedValue;
    

    But you may not interesting to use this method. You can write all use statements to one file and just include it in your entities.

提交回复
热议问题