<?php
/**
 * Created by AKKA -- mb.
 * User: Boulabiar Marwen
 * Date: 11/04/2019
 * Time: 15:28
 */

namespace AppBundle\Entity\Repositories;


use Doctrine\ORM\EntityRepository;

class InterlocuteurRepository extends EntityRepository
{
    public function getInterlocuteurBySiret($siret,$userId){
        return $this->createQueryBuilder("i")
            ->where("i.siret = :siret")
            ->join("i.utilisateur","u")
            ->andWhere("u.id = :userId")
            ->setParameters(['siret' => $siret,"userId" => $userId])
            ->getQuery()
            ->getResult();
    }
}