'config' =>
$document->
getConfig(),
'deepLinkCode' =>
$deepLinkCode,
'referencedDocumentId' =>
$operation->
getReferencedDocumentId(),
];
$result->
addSuccess(new DocumentIdStruct($id,
$deepLinkCode,
$mediaId));
} catch (\Throwable
$exception) { $result->
addError($orderId,
$exception);
} } $this->
writeRecords($records,
$context);
return $result;
} public function upload(string
$documentId, Context
$context, Request
$uploadedFileRequest): DocumentIdStruct
{ /** @var DocumentEntity $document */
$document =
$this->documentRepository->
search(new Criteria([$documentId]),
$context)->
first();
if (!
($document instanceof DocumentEntity
)) { throw DocumentException::
documentNotFound($documentId);
}