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.

CreditHistoryStore.php 1.1KB

пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace Lc\CaracoleBundle\Repository\Credit;
  3. use App\Entity\User\UserMerchant;
  4. use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
  5. use Lc\SovBundle\Repository\AbstractStore;
  6. use DateTime;
  7. class CreditHistoryStore extends AbstractStore
  8. {
  9. use MerchantStoreTrait;
  10. protected CreditHistoryRepositoryQuery $query;
  11. public function __construct(CreditHistoryRepositoryQuery $query)
  12. {
  13. $this->query = $query;
  14. }
  15. //findAllByDateStartEnd
  16. public function getByDateStartEnd(DateTime $dateStart, DateTime $dateEnd): array
  17. {
  18. $query = $this->query->create();
  19. $query
  20. ->filterByJoinUserMerchant($this->merchant)
  21. ->filterByDateStart($dateStart)
  22. ->filterByDateEnd($dateEnd)
  23. ->orderBy('.createdAt');
  24. return $query->find();
  25. }
  26. //findAllByUserMerchant
  27. public function getByUserMerchant(UserMerchant $userMerchant): array
  28. {
  29. $query = $this->query->create();
  30. $query
  31. ->filterByUserMerchant($userMerchant)
  32. ->orderBy('.createdAt', 'DESC');
  33. return $query->find();
  34. }
  35. }