<?php
/**
* @version 1.0.0
* @category Anahita Social Engineâ¢
* @copyright Copyright (C) 2008 - 2010 rmdStudio Inc. and Peerglobe Technology Inc. All rights reserved.
* @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
* @link http://www.anahitapolis.com
*/
class ComSocialengineControllerNotification extends ComSocialengineControllerBase
{
public function __construct($options=array())
{
parent::__construct($options);
KFactory::get('lib.anahita.domain.factory.mapper')->get('lib.anahita.model.person.story.notification');
$this->registerAuthentication();
}
public function _actionBrowse()
{
$notifiactions = $this->getViewer()->notifications
->order('date', 'DESC')
->limit($this->getLimit(), $this->getOffset());
$this->view()->assign('notifications', $notifiactions);
parent::_actionBrowse();
}
public function _actionDelete()
{
$id = KRequest::get('get.id', 'int', 0);
$notification = $this->getViewer()->notifications->where('id','=',$id)->fetch();
if ( $notification )
$notification->markDeleted();
KFactory::get('lib.anahita.domain.context')->save();
}
//end class
}