add Order Entity and API Basics

This commit is contained in:
Marko
2022-06-22 17:01:26 +02:00
parent 0bc342bf6d
commit ea473db7bf
23 changed files with 4781 additions and 667 deletions

0
src/Repository/.gitignore vendored Normal file
View File

View File

@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Orders;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Orders>
*
* @method Orders|null find($id, $lockMode = null, $lockVersion = null)
* @method Orders|null findOneBy(array $criteria, array $orderBy = null)
* @method Orders[] findAll()
* @method Orders[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class OrdersRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Orders::class);
}
public function add(Orders $entity, bool $flush = false): void
{
$this->getEntityManager()->persist($entity);
if ($flush) {
$this->getEntityManager()->flush();
}
}
public function remove(Orders $entity, bool $flush = false): void
{
$this->getEntityManager()->remove($entity);
if ($flush) {
$this->getEntityManager()->flush();
}
}
// /**
// * @return Orders[] Returns an array of Orders 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): ?Orders
// {
// return $this->createQueryBuilder('o')
// ->andWhere('o.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}