<?php
/**
 * Created by PhpStorm.
 * User: Arthur Touzard
 * Date: 16/04/2018
 * Time: 14:02
 */

namespace AppBundle\Entity\Repositories;


use AppBundle\Entity\Utilisateur;
use Doctrine\ORM\EntityRepository;

class ThematiqueRepository extends EntityRepository
{
    public function getThematiques($codeAgence)
    {
        return $this->getEntityManager()->createQueryBuilder()
            ->select('t.code, t.intitule')
            ->from('AppBundle:Thematique', 't')
            ->where("t.agenceCodeAgence = '$codeAgence' and t.visible = 1")
            ->orderBy('t.code')
            ->getQuery()
            ->getResult();
    }
}