WIP: Implement admin CRUD

This commit is contained in:
Björn Fromme committed 2023-09-26 17:44:01 +02:00
1 parent 3e0353c79b
commit c55fd85314
63 files changed
+1367 -532

No files matched your search

+9 -39
View File
@@ -21,46 +21,16 @@ class JobProfileRepository extends ServiceEntityRepository
parent::__construct($registry, JobProfile::class);
}
public function save(JobProfile $entity, bool $flush = false): void
public function getList(): array
{
$this->getEntityManager()->persist($entity);
$qb = $this->createQueryBuilder('job_profile');
if ($flush) {
$this->getEntityManager()->flush();
}
return $qb
->select('job_profile', 'required_training')
->leftJoin('job_profile.requiredTraining', 'required_training')
->orderBy('job_profile.name', 'ASC')
->getQuery()
->getResult()
;
}
public function remove(JobProfile $entity, bool $flush = false): void
{
$this->getEntityManager()->remove($entity);
if ($flush) {
$this->getEntityManager()->flush();
}
}
// /**
// * @return JobProfile[] Returns an array of JobProfile objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('j')
// ->andWhere('j.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('j.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?JobProfile
// {
// return $this->createQueryBuilder('j')
// ->andWhere('j.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}