$this->
View()->
assign(['success' => false, 'message' =>
$e->
getMessage()]);
} } /**
* @throws Exception
*/
private function createThumbnailsForMovedMedia(Media
$media): void
{ $albumRepository =
$this->
get(ModelManager::
class)->
getRepository(Album::
class);
$album =
$albumRepository->
find($media->
getAlbumId());
if ($album instanceof Album
) { $media->
removeAlbumThumbnails($album->
getSettings()->
getThumbnailSize(),
$media->
getFileName());
$media->
createAlbumThumbnails($album);
} } /**
* The internal toTree method iterates the given model and converts it into an array.
* At the same time number of associated media is determined to the album.
* If an album have sub-albums, the number of associated media of the sub-album added to the
* media count of the parent album.
*
* @param array<string, mixed>|ArrayCollection $data
* @param array<string, mixed>|null $parent
*
* @return array<int, array<string, mixed>>
*/