Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

30 lines
1.1KB

  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. }