createQueryBuilder('contact_point') ->innerJoin('contact_point.organization', 'organization') ->where('contact_point.contactType = :type') ->andWhere('organization.id = :organizationId') ->setParameter('type', $type) ->setParameter('organizationId', $organization->getId()) ->getQuery() ->getResult() ; } /** * Récupération des points de contacts d'une person et d'un type précis * @param String $type * @param Person $person * @return array|null */ public function getByTypeAndPerson(String $type, Person $person): array | null{ return $this->createQueryBuilder('contact_point') ->innerJoin('contact_point.person', 'person') ->where('contact_point.contactType = :type') ->andWhere('person.id = :personId') ->setParameter('type', $type) ->setParameter('personId', $person->getId()) ->getQuery() ->getResult() ; } }