This commit is contained in:
lubiana 2025-06-15 13:57:17 +02:00
parent 9d2f0204e3
commit ee32852789
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
12 changed files with 514 additions and 3 deletions

View file

@ -0,0 +1,25 @@
<?php declare(strict_types=1);
namespace App\State;
use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProviderInterface;
use App\Entity\FoodOrder;
use App\Repository\FoodOrderRepository;
use Override;
final readonly class OpenOrdersProvider implements ProviderInterface
{
public function __construct(
private FoodOrderRepository $repository
) {}
/**
* @return FoodOrder[]
*/
#[Override]
public function provide(Operation $operation, array $uriVariables = [], array $context = []): array
{
return $this->repository->findOpenOrders();
}
}