CodeExplorer rollbackRenameAction example
$this->urlGenerator->
getRelativeMediaUrl($updatedMedia),
$this->
getFileSystem($currentMedia) );
} catch (\Exception
) { throw MediaException::
couldNotRenameFile($currentMedia->
getId(),
(string) $currentMedia->
getFileName());
} foreach ($currentMedia->
getThumbnails() ??
[] as $thumbnail) { try { $renamedFiles =
[...
$renamedFiles, ...
$this->
renameThumbnail($thumbnail,
$currentMedia,
$updatedMedia)];
} catch (\Exception
) { $this->
rollbackRenameAction($currentMedia,
$renamedFiles);
} } $updateData =
[ 'id' =>
$updatedMedia->
getId(),
'fileName' =>
$updatedMedia->
getFileName(),
'uploadedAt' =>
$updatedMedia->
getUploadedAt(),
];
try { $context->
scope(Context::SYSTEM_SCOPE,
function DContext
$context) use ($updateData): void
{