/** * @param QueryBuilder $qb * @param EmailRecipientsProviderArgs $args * * @return array */ protected function getRestrictedResult(QueryBuilder $qb, EmailRecipientsProviderArgs $args) { if ($args->getOrganization()) { $qb->andWhere('o.id = :organization')->setParameter('organization', $args->getOrganization()); } return $this->aclHelper->apply($qb)->getResult(); }