<?php

namespace Project\AppBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * EvaluationRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class EvaluationRepository extends EntityRepository
{
    public function findAllBySpeaker($speakerId)
    {
        return $this->getEntityManager()
                ->createQuery(
                        'SELECT e
                        FROM ProjectAppBundle:Evaluation e
                        WHERE e.speaker = :speaker'
                )
                ->setParameter('speaker', $speakerId)
                ->getResult();
    }
}

<?php

namespace Project\AppBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * EvaluationRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class EvaluationRepository extends EntityRepository
{
    public function findAllBySpeaker($speakerId)
    {
        return $this->getEntityManager()
                ->createQuery(
                        'SELECT e
                        FROM ProjectAppBundle:Evaluation e
                        WHERE e.speaker = :speaker'
                )
                ->setParameter('speaker', $speakerId)
                ->getResult();
    }

    public function findAllUnvalidatedByPromotion($promotionId)
    {
        return $this->getEntityManager()
            ->createQuery(
                          'SELECT e
FROM ProjectAppBundle:Evaluation e
LEFT JOIN e.module m
LEFT JOIN m.promotion p
WHERE p.id = :promotion
AND e.validated = 0'
                          )
            ->setParameter('promotion', $promotionId)
            ->getResult();
    }
}

Add method to retrieve unvalidated evaluations
Add method to retrieve unvalidated evaluations
