|
123456789101112131415161718192021222324252627282930 |
- <?php
-
- namespace Lc\ShopBundle\Repository;
-
- use Lc\ShopBundle\Context\DefaultRepositoryInterface;
- use Lc\ShopBundle\Context\UserInterface;
-
- /**
- * @method UserInterface|null find($id, $lockMode = null, $lockVersion = null)
- * @method UserInterface|null findOneBy(array $criteria, array $orderBy = null)
- * @method UserInterface[] findAll()
- * @method UserInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
- class UserRepository extends BaseRepository implements DefaultRepositoryInterface
- {
- public function getInterfaceClass()
- {
- return UserInterface::class;
- }
-
- public function findAllByNewsletter($newsletter)
- {
- return $this->createQueryBuilder('e')
- ->where(':newsletter MEMBER OF e.newsletters')
- ->setParameter('newsletter', $newsletter->getId())
- ->getQuery()
- ->getResult() ;
- }
-
- }
|