WIP: Implement model

This commit is contained in:
Björn Fromme
2023-09-12 18:17:24 +02:00
parent 35ca61d21b
commit f8c9ff82a5
35 changed files with 2935 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Repository;
use App\Entity\Disposition;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Disposition>
*
* @method Disposition|null find($id, $lockMode = null, $lockVersion = null)
* @method Disposition|null findOneBy(array $criteria, array $orderBy = null)
* @method Disposition[] findAll()
* @method Disposition[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class DispositionRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Disposition::class);
}
public function save(Disposition $entity, bool $flush = false): void
{
$this->getEntityManager()->persist($entity);
if ($flush) {
$this->getEntityManager()->flush();
}
}
public function remove(Disposition $entity, bool $flush = false): void
{
$this->getEntityManager()->remove($entity);
if ($flush) {
$this->getEntityManager()->flush();
}
}
// /**
// * @return Disposition[] Returns an array of Disposition objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('d')
// ->andWhere('d.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('d.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Disposition
// {
// return $this->createQueryBuilder('d')
// ->andWhere('d.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}