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.

VisitorRepositoryQuery.php 981B

пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Lc\CaracoleBundle\Repository\User;
  3. use Knp\Component\Pager\PaginatorInterface;
  4. use Lc\SovBundle\Repository\AbstractRepositoryQuery;
  5. class VisitorRepositoryQuery extends AbstractRepositoryQuery
  6. {
  7. public function __construct(VisitorRepository $repository, PaginatorInterface $paginator)
  8. {
  9. parent::__construct($repository, 'visitor', $paginator);
  10. }
  11. public function filterByCookie(string $cookie = null)
  12. {
  13. return $this
  14. ->andWhere('.cookie LIKE :cookie')
  15. ->setParameter('cookie', $cookie);
  16. }
  17. public function filterByLastAccess(\DateTime $lastAccess)
  18. {
  19. return $this
  20. ->andWhere('.lastAccess < :lastAccess')
  21. ->setParameter('lastAccess', $lastAccess);
  22. }
  23. public function filterByTotalVisit(int $totalVisit)
  24. {
  25. return $this
  26. ->andWhere('.totalVisit = :totalVisit')
  27. ->setParameter('totalVisit', $totalVisit);
  28. }
  29. }