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\Assignment;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Assignment>
*
* @method Assignment|null find($id, $lockMode = null, $lockVersion = null)
* @method Assignment|null findOneBy(array $criteria, array $orderBy = null)
* @method Assignment[] findAll()
* @method Assignment[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class AssignmentRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Assignment::class);
}
public function save(Assignment $entity, bool $flush = false): void
{
$this->getEntityManager()->persist($entity);
if ($flush) {
$this->getEntityManager()->flush();
}
}
public function remove(Assignment $entity, bool $flush = false): void
{
$this->getEntityManager()->remove($entity);
if ($flush) {
$this->getEntityManager()->flush();
}
}
// /**
// * @return Assignment[] Returns an array of Assignment objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('a')
// ->andWhere('a.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('a.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Assignment
// {
// return $this->createQueryBuilder('a')
// ->andWhere('a.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}