add order
This commit is contained in:
parent
7663f684a4
commit
1dc5306967
37 changed files with 1060 additions and 113 deletions
26
src/Repository/FoodOrderRepository.php
Normal file
26
src/Repository/FoodOrderRepository.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\FoodOrder;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<FoodOrder>
|
||||
*/
|
||||
final class FoodOrderRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, FoodOrder::class);
|
||||
}
|
||||
|
||||
public function save(FoodOrder $order): void
|
||||
{
|
||||
$this->getEntityManager()
|
||||
->persist($order);
|
||||
$this->getEntityManager()
|
||||
->flush();
|
||||
}
|
||||
}
|
43
src/Repository/OrderItemRepository.php
Normal file
43
src/Repository/OrderItemRepository.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\OrderItem;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<OrderItem>
|
||||
*/
|
||||
final class OrderItemRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, OrderItem::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return OrderItem[] Returns an array of OrderItem objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('o')
|
||||
// ->andWhere('o.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('o.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?OrderItem
|
||||
// {
|
||||
// return $this->createQueryBuilder('o')
|
||||
// ->andWhere('o.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue