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.

41 lines
1.2KB

  1. <?php
  2. namespace Lc\ShopBundle\Repository;
  3. use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepositoryInterface;
  4. use Doctrine\ORM\EntityManager;
  5. use Doctrine\ORM\EntityRepository;
  6. class BaseRepository extends EntityRepository implements ServiceEntityRepositoryInterface
  7. {
  8. /**
  9. * @param string $entityClass The class name of the entity this repository manages
  10. */
  11. public function __construct(EntityManager $entityManager, $entityClass)
  12. {
  13. parent::__construct($entityManager, $entityManager->getClassMetadata($entityClass));
  14. }
  15. public function findAllOfflineAndDelete()
  16. {
  17. return $this->createQueryBuilder('e')
  18. ->andWhere('e.status < = 0')
  19. ->orderBy('e.status', "DESC")
  20. ->getQuery()
  21. ->getResult();
  22. }
  23. public function filterByMerchant($merchant){
  24. return $this->createQueryBuilder('e')
  25. ->where('e.merchant = :currentMerchant')
  26. ->setParameter('currentMerchant', $merchant->getId())
  27. ->getQuery()
  28. ->getResult();
  29. }
  30. }