/**
* postSave
*
* @param Data $data
*
* @throws ValidFailException
*/
protected function postSave(Data $data)
{
$input = array('item' => array('topic_id' => $data->id, 'primary' => 1, 'body' => $data->body));
if (!$this->hmvc($controller = new \Forum\Controller\Post\SaveController(), $input)) {
list($url, $msg, $type) = $controller->getRedirect(true);
throw new ValidFailException($msg);
}
$post = $controller->getPost();
$data->last_reply_post = $post->id;
// Add Notification
Notification::addNotification('topic', $data->id, $data->user_id);
}