How to access repository methods for an entity in symfony2?

前端 未结 4 587
青春惊慌失措
青春惊慌失措 2020-12-15 22:10

I am stuck with a problem please help me with it. Here is the scenarario:

I have an entity \"User\" and corresponding repository \"UserRepository\", inside my entit

4条回答
  •  萌比男神i
    2020-12-15 23:03

    You need to declare the UserRepository as an EntityRepository for your user entity. In your User entity add this annotation:

    /**
     * @ORM\Entity(repositoryClass="Acme\StoreBundle\Entity\UserRepository")
     */
    

    See the docs for a more detailed description.

提交回复
热议问题