public function checkin()
{
// CSRF prevention
$this->csrfProtection();
$model = $this->getModel()->savestate(false);
$ids = $this->getIDsFromRequest($model, false);
$error = null;
try {
$status = true;
foreach ($ids as $id) {
$model->find($id);
$model->checkIn();
}
} catch (\Exception $e) {
$status = false;
$error = $e->getMessage();
}
// Redirect
if ($customURL = $this->input->getBase64('returnurl', '')) {
$customURL = base64_decode($customURL);
}
$url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->container->componentName . '&view=' . $this->container->inflector->pluralize($this->view) . $this->getItemidURLSuffix();
if (!$status) {
$this->setRedirect($url, $error, 'error');
} else {
$this->setRedirect($url);
}
}