1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace Entity\Repository;
- use Doctrine\ORM\EntityRepository;
- use Doctrine\Common\Collections\Criteria;
- class JuryRepository extends EntityRepository
- {
-
- public function getJuryByPresidentId($userId)
- {
- $qb = $this->createQueryBuilder('a');
-
- $qb->select('DISTINCT u');
-
- $qb->from('Entity\Jury', 'u');
-
- $qb->innerJoin('u.members', 'c');
-
- $qb->innerJoin('c.role', 'r');
-
-
- $wherePart = $qb->expr()->andx();
-
- $wherePart->add($qb->expr()->eq('r.role', $qb->expr()->literal('ROLE_JURY_PRESIDENT')));
- $wherePart->add($qb->expr()->eq('c.userId', $userId));
- $qb->where($wherePart);
- $q = $qb->getQuery();
- return $q->getSingleResult();
-
- }
- public function getExerciseAttemptsByJury($juryId)
- {
- }
- }
|