Feat: Refactor application rejecting process

This commit is contained in:
Björn Fromme
2023-10-19 10:24:53 +02:00
parent 2c49c142b8
commit 21968b833c
12 changed files with 185 additions and 66 deletions
+19
View File
@@ -3,6 +3,7 @@
namespace App\Repository;
use App\Entity\Application;
use App\Entity\Assignment;
use App\Entity\Teamer;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\Query;
@@ -53,4 +54,22 @@ class ApplicationRepository extends ServiceEntityRepository
->getQuery()
;
}
public function getCurrentByAssignment(Assignment $assignment): array
{
$qb = $this->createQueryBuilder('application');
return $qb
->select('application', 'teamer')
->innerJoin('application.teamer', 'teamer')
->where($qb->expr()->andX(
$qb->expr()->eq('application.assignment', ':assignment'),
$qb->expr()->neq('application.status', ':status')
))
->setParameter('assignment', $assignment)
->setParameter('status', Application::STATUS_REJECTED)
->getQuery()
->getResult()
;
}
}