WIP: Implementation of stuff goes on

This commit is contained in:
Björn Fromme
2023-10-05 12:53:17 +02:00
parent 96d6170907
commit 1097b84447
23 changed files with 443 additions and 118 deletions
+6 -40
View File
@@ -4,6 +4,7 @@ namespace App\Repository;
use App\Entity\Assignment;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\Query;
use Doctrine\Persistence\ManagerRegistry;
/**
@@ -21,46 +22,11 @@ class AssignmentRepository extends ServiceEntityRepository
parent::__construct($registry, Assignment::class);
}
public function save(Assignment $entity, bool $flush = false): void
public function getListQuery(): Query
{
$this->getEntityManager()->persist($entity);
if ($flush) {
$this->getEntityManager()->flush();
}
return $this
->createQueryBuilder('assignment')
->getQuery()
;
}
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()
// ;
// }
}