Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
716cf56cb2.url-de-test.ws
/
htdocs
/
src
/
Repository
/
/srv/data/web/vhosts/716cf56cb2.url-de-test.ws/htdocs/src/Repository/BookingRepository.php
<?php namespace App\Repository; use App\Entity\Booking; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; /** * @extends ServiceEntityRepository<Booking> * * @method Booking|null find($id, $lockMode = null, $lockVersion = null) * @method Booking|null findOneBy(array $criteria, array $orderBy = null) * @method Booking[] findAll() * @method Booking[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ class BookingRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $registry) { parent::__construct($registry, Booking::class); } public function add(Booking $entity, bool $flush = false): void { $this->getEntityManager()->persist($entity); if ($flush) { $this->getEntityManager()->flush(); } } public function remove(Booking $entity, bool $flush = false): void { $this->getEntityManager()->remove($entity); if ($flush) { $this->getEntityManager()->flush(); } } public function findBookingsPayRest($date): array { return $this->createQueryBuilder('b') ->andWhere('b.statusAdvance = :paid') ->andWhere('b.statusRest = :pending') ->andWhere('b.checkin <= :date') ->andWhere('b.tokenRest IS NOT NULL') ->andWhere('b.isCancel = false') ->setParameter('paid', Booking::STATUS_PAID) ->setParameter('pending', Booking::STATUS_PENDING) ->setParameter('date', $date) ->getQuery() ->getResult(); } public function findBookingsNotImported($order): array { return $this->createQueryBuilder('b') ->andWhere('b.isImported = false') ->orderBy('b.id', $order) ->getQuery() ->getResult(); } public function findBookingsImported(): array { return $this->createQueryBuilder('b') ->andWhere('b.isImported = true') ->getQuery() ->getResult(); } }