<?php
/**
 * Created by PhpStorm.
 * User: Arthur Touzard
 * Date: 19/04/2018
 * Time: 15:28
 */

namespace AppBundle\Entity\Repositories;

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

class TelechargementDocumentDispositionRepository extends EntityRepository
{
    public function findTelechargerInterlocuteur($i_list)
    {

        $docs = $this->getEntityManager()->createQueryBuilder()
                ->select('tdd')
                ->from('AppBundle:TelechargementDocumentDisposition', 'tdd')
                ->innerJoin('tdd.utilisateur', 'u')
                ->innerJoin('u.interlocuteurSiret', 'i', 'with', 'i.siret IN (:i_list)')
                ->setParameter('i_list', $i_list)
                ->getQuery()
                ->getResult();

        return $docs;
    }

}
