throw new ModelNotFoundException(Banner::
class,
(int) $id);
} } else { // Check if there are none files submitted
if (empty($mediaManagerData)) { $this->
View()->
assign([ 'success' => false,
'errorMsg' =>
$this->namespace->
get('no_banner_selected', 'No banner has been selected.'
),
]);
return;
} $bannerModel =
new Banner();
} // Read data
$bannerModel->
fromArray($params);
// Set new image and extension if necessary
if (!
empty($mediaManagerData)) { $bannerModel->
setImage($mediaManagerData);
} // Strip full qualified url
$mediaService =
$this->
get(MediaServiceInterface::
class);