// Check if a new album id is passed and is valid
if (isset($params['newAlbumID'
]) && !
empty($params['newAlbumID'
])) { $album =
$this->
get(ModelManager::
class)->
getRepository(Album::
class)->
find($params['newAlbumID'
]);
if ($album instanceof Album
) { $media->
setAlbum($album);
$media->
setAlbumId($params['newAlbumID'
]);
} $this->
createThumbnailsForMovedMedia($media);
} // Check if the description is passed
if (isset($params['description'
])) { $media->
setDescription($params['description'
]);
} try { $this->
get('models'
)->
persist($media);
$this->
get('models'
)->
flush();