$fetchedContact =
$this->entityManager->
getReference( Contact::
class,
$contact->
getId() );
if ($fetchedContact instanceof Contact
) { $associatedContacts[] =
$fetchedContact;
} } $collection =
new ArrayCollection($associatedContacts);
$logEntry->
setRecipients($collection);
} protected function getKnownRecipients(array
$recipients): array
{ $qb =
$this->entityManager->
getConnection()->
createQueryBuilder();
$tableName =
$this->entityManager->
getClassMetadata(Contact::
class)->
getTableName();
$qb->
select('*'
) ->
from($tableName) ->
add('where',
$qb->
expr()->
in('mail_address', ':recipients'
)) ->
setParameter('recipients',
$recipients, Connection::PARAM_STR_ARRAY
);