forked from lubiana/futtern
api api
This commit is contained in:
parent
9d2f0204e3
commit
ee32852789
12 changed files with 514 additions and 3 deletions
25
src/State/OpenOrdersProvider.php
Normal file
25
src/State/OpenOrdersProvider.php
Normal 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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue