WIP: Implement application process

This commit is contained in:
Björn Fromme
2023-10-09 16:59:35 +02:00
parent abced8c924
commit 3a458df94f
17 changed files with 441 additions and 219 deletions
+18 -4
View File
@@ -3,6 +3,7 @@
namespace App\Repository;
use App\Entity\Assignment;
use App\Entity\Teamer;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\Query;
use Doctrine\Persistence\ManagerRegistry;
@@ -22,11 +23,24 @@ class AssignmentRepository extends ServiceEntityRepository
parent::__construct($registry, Assignment::class);
}
public function getListQuery(): Query
public function getListQuery(Teamer $teamer = null): Query
{
return $this
->createQueryBuilder('assignment')
->getQuery()
$qb = $this->createQueryBuilder('assignment');
$qb
->select('assignment', 'destination', 'job_profile', 'application')
->innerJoin('assignment.destination', 'destination')
->innerJoin('assignment.jobProfile', 'job_profile')
->leftJoin('assignment.applications', 'application')
;
if (null !== $teamer) {
$qb
->where($qb->expr()->eq('application.teamer', ':teamer'))
->setParameter('teamer', $teamer)
;
}
return $qb->getQuery();
}
}