$manager =
$this->
get(Manager::
class);
$manager->
createMediaThumbnail($media,
[], true
);
} $mediaService =
$this->
get(MediaServiceInterface::
class);
$data[0
]['path'
] =
$mediaService->
getUrl($data[0
]['path'
]);
$this->
View()->
assign(['success' => true, 'data' =>
$data[0
]]);
} catch (Exception
$e) { unlink($file->
getPathname());
$this->
View()->
assign(['success' => false, 'message' =>
$e->
getMessage(), 'exception' =>
$this->
parseExceptionForResponse($e)]);
} } /**
* The saveAlbumAction is used to save a new album and update an existing album.
* The function expects the following parameters:
* <code>
* id => [int] May be null if a new album to be saved.
* text => [string] Name of the album to be saved.
* parentId => [int] Id of the parent album. 0 if the album is to be stored at the highest level.
* position => [int] Position of the album within the tree.
* iconCls => [string] Css class for the album tree node
* createThumbnails => [int] Flag if thumbnails should be created.
* thumbnailSize => [array] Array of thumbnail sizes
* </code>
*
* @return void
*/