ratzen
This commit is contained in:
parent
203233d2ed
commit
93fa2da696
45 changed files with 2633 additions and 550 deletions
|
@ -1,12 +1,10 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\FoodOrder;
|
||||
use DateTime;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
|
@ -25,17 +23,13 @@ class FoodOrderRepository extends ServiceEntityRepository
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, FoodOrder>
|
||||
* @return FoodOrder[] Returns an array of FoodOrder objects
|
||||
*/
|
||||
public function findOpen(int $limit = 10): Collection
|
||||
public function findOpenOrders(): array
|
||||
{
|
||||
$yesterday = new DateTime;
|
||||
$yesterday->modify('-1 day');
|
||||
$queryBuilder = $this->createQueryBuilder('e');
|
||||
$queryBuilder
|
||||
->where('e.closedAt IS NULL')
|
||||
->andWhere($queryBuilder->expr()->gte('e.startedAt', ':yesterday'))
|
||||
->setParameter('yesterday', $yesterday);
|
||||
return new ArrayCollection($queryBuilder->getQuery()->getResult());
|
||||
return $this->createQueryBuilder('f')
|
||||
->andWhere('f.closedAt IS NULL')
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue