$documentIds =
$extensions->
getDocumentIds();
if (!
empty($eventConfig['documentTypeIds'
]) && \
is_array($eventConfig['documentTypeIds'
]) &&
$orderId) { $latestDocuments =
$this->
getLatestDocumentsOfTypes($orderId,
$eventConfig['documentTypeIds'
]);
$documentIds =
array_unique(array_merge($documentIds,
$latestDocuments));
} if (!
empty($documentIds)) { $extensions->
setDocumentIds($documentIds);
$attachments =
$this->
mappingAttachments($documentIds,
$attachments,
$context);
} if (empty($extensions->
getMediaIds())) { return $attachments;
} $criteria =
new Criteria($extensions->
getMediaIds());
$criteria->
setTitle('send-mail::load-media'
);
/** @var MediaCollection<MediaEntity> $entities */
$entities =
$this->mediaRepository->
search($criteria,
$context);