/**
* @param array<string> $documentTypes
*
* @throws Exception
* @throws \Doctrine\DBAL\Exception
*
* @return array<string>
*/
private function getDocumentIds(string
$entity, string
$referencedId, array
$documentTypes, bool
$skipSentDocuments): array
{ if (!\
in_array($entity,
['order', 'order_transaction', 'order_delivery'
], true
)) { throw new NotFoundHttpException();
} $query =
$this->connection->
createQueryBuilder();
$query->
select([ 'LOWER(hex(document.document_type_id)) as doc_type',
'LOWER(hex(document.id)) as doc_id',
'document.created_at as newest_date',
'document.sent as sent',
]);
$query->
from('document', 'document'
);
$query->
innerJoin('document', 'document_type', 'document_type', 'document.document_type_id = document_type.id'
);