forked from lubiana/futtern
21 lines
549 B
PHP
21 lines
549 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace App\State;
|
|
|
|
use ApiPlatform\Metadata\Operation;
|
|
use ApiPlatform\State\ProviderInterface;
|
|
use App\Repository\FoodOrderRepository;
|
|
use Override;
|
|
|
|
final readonly class OpenFoodOrderProvider implements ProviderInterface
|
|
{
|
|
public function __construct(
|
|
private FoodOrderRepository $repository
|
|
) {}
|
|
|
|
#[Override]
|
|
public function provide(Operation $operation, array $uriVariables = [], array $context = []): object|array|null
|
|
{
|
|
return $this->repository->findOpenOrders();
|
|
}
|
|
}
|