Doctrine2 - “class” is not a valid entity or mapped super class

后端 未结 5 2069
庸人自扰
庸人自扰 2020-12-05 06:42

I get exception Uncaught exception \'Doctrine\\ORM\\Mapping\\MappingException\' with message \'Class \"Users\" is not a valid entity or mapped super class every

5条回答
  •  时光说笑
    2020-12-05 07:20

    In my case, I just forgot to add @ORM\Entity, like this:

    /**
     * Project\BackendBundle\Entity\Pedido
     *
     * @ORM\Table
     * @ORM\Entity
     * @ORM\HasLifecycleCallbacks
     */
    class Pedido
    

提交回复
热议问题