//src/DemoBundle/Repositories/ProductRepository.php<?phpnamespaceDemoBundle\Repositories;useDoctrine\ORM\EntityRepository;classProductRepositoryextendsEntityRepository{publicfunctionfindAllOrderedByName() {return$this->getEntityManager()->createQuery('SELECT p FROM DemoBundle\Entities\Product p ORDER BY p.name ASC')->getResult(); }}
//src/DemoBundle/Repositories/ProductPriceRepository.php<?phpnamespaceDemoBundle\Repositories;useDoctrine\ORM\EntityRepository;useEspierBundle\Traits\RepositoryFactory;useDemoBundle\Entities\Product;classProductPriceRepositoryextendsEntityRepository{publicstatic $entityClass =Product::class;useRepositoryFactory;publicfunctionfindAllOrderedByName() {return$this->getEntityManager()->createQuery('SELECT p FROM DemoBundle\Entities\Product p ORDER BY p.name ASC')->getResult(); }}