public function actionSave()
{
$notificationId = $this->_input->filterSingle('notification_id', XenForo_Input::UINT);
// This pulls the notificationId out of the requested URL, e.g. if it's an existing notification then $notificationId will now contain 1
$data = $this->_input->filter(array(
'name' => XenForo_Input::STRING,
'other_data' => XenForo_Input::STRING
));
$writer = XenForo_DataWriter::create('Notifications_DataWriter_Notification');
if ($notificationId)
{
$writer->setExistingData($notificationId);
}
// So, if notificationId exists, tell DataWriter to find the existing data.
$writer->bulkSet($data);
$writer->save();
return $this->responseRedirect(
XenForo_ControllerResponse_Redirect::SUCCESS,
XenForo_Link::buildAdminLink('notifications/edit', $notificationId)
);
}