/** @var Album|null $album */
$album =
$this->
get('models'
)->
find(Album::
class,
$albumId);
if (!
$album) { $this->
View()->
assign(['success' => false, 'message' => 'Invalid album id passed'
]);
return;
} $media->
setAlbum($album);
$media->
setDescription(''
);
$media->
setCreated(new DateTime());
$identity =
$this->
get('auth'
)->
getIdentity();
if ($identity !== null
) { $media->
setUserId($identity->id
);
} else { $media->
setUserId(self::FALLBACK_USER_ID
);
} $this->
Response()->headers->
set('content-type', 'text/plain'
);