You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PointSaleRepository.php 1.5KB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace Lc\ShopBundle\Repository;
  3. use Lc\ShopBundle\Context\DefaultRepositoryInterface;
  4. use Lc\ShopBundle\Context\PointSaleInterface;
  5. /**
  6. * @method PointSaleInterface|null find($id, $lockMode = null, $lockVersion = null)
  7. * @method PointSaleInterface|null findOneBy(array $criteria, array $orderBy = null)
  8. * @method PointSaleInterface[] findAll()
  9. * @method PointSaleInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
  10. */
  11. class PointSaleRepository extends BaseRepository implements DefaultRepositoryInterface
  12. {
  13. public function getInterfaceClass()
  14. {
  15. return PointSaleInterface::class;
  16. }
  17. public function findAllPublics()
  18. {
  19. return $this->createQueryBuilder('e')
  20. ->where(':currentMerchant MEMBER OF e.merchants')
  21. ->andWhere('e.isPublic = 1')
  22. ->andWhere('e.status = 1')
  23. ->setParameter('currentMerchant', $this->merchantUtils->getMerchantCurrent())
  24. ->getQuery()
  25. ->getResult() ;
  26. }
  27. public function findAllByMerchant()
  28. {
  29. return $this->createQueryBuilder('e')
  30. ->where(':currentMerchant MEMBER OF e.merchants')
  31. ->andWhere('e.status = 1')
  32. ->setParameter('currentMerchant', $this->merchantUtils->getMerchantCurrent())
  33. ->getQuery()
  34. ->getResult() ;
  35. }
  36. }