CreditHistoryRepository.php 1.1KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Lc\ShopBundle\Repository;
  3. use Lc\ShopBundle\Context\DefaultRepositoryInterface;
  4. use Lc\ShopBundle\Context\CreditHistoryInterface;
  5. /**
  6. * @method CreditHistoryInterface|null find($id, $lockMode = null, $lockVersion = null)
  7. * @method CreditHistoryInterface|null findOneBy(array $criteria, array $orderBy = null)
  8. * @method CreditHistoryInterface[] findAll()
  9. * @method CreditHistoryInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
  10. */
  11. class CreditHistoryRepository extends BaseRepository implements DefaultRepositoryInterface
  12. {
  13. public function getInterfaceClass()
  14. {
  15. return CreditHistoryInterface::class;
  16. }
  17. public function findAllByUserMerchant($userMerchant)
  18. {
  19. return $this->createQueryBuilder('e')
  20. ->andWhere('e.userMerchant = :userMerchant')
  21. ->setParameter('userMerchant', $userMerchant)
  22. ->addOrderBy('e.createdAt', 'DESC')
  23. ->getQuery()->getResult();
  24. }
  25. }