Symfony2 custom repository class
问题 I am new to symfony2 and I am trying to create custom repository class and couldn' do it. Here is what I am doing: I added annotation to entity class ( MobilePhones ) @ORM\Entity(repositoryClass="Maak\DefaultBundle\Entity\MobilePhonesRepository") In MobilePhonesRepository I created my custom function named findAllMobilePhones() In controller I called function using: $em->getRepository('MaakDefaultBundle:MobilePhones')->findAllMobilePhones(); but I get Undefined method findAllMobilePhones() ,