<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
class Core_Widget_AdminNotificationController extends Engine_Content_Widget_Abstract
{
  public function indexAction()  {
    // Notifications
    // Hook-based
    $event = Engine_Hooks_Dispatcher::_()->callEvent('getAdminNotifications');
    $this->view->notifications = $event->getResponses();
    // Database-based
    $select = Engine_Api::_()->getDbtable('log', 'core')->select()
      ->where('domain = ?', 'admin')
      ->order('timestamp DESC')
      ;
      
    $this->view->paginator = $paginator = Zend_Paginator::factory($select);
    $paginator->setItemCountPerPage(4);
  }
}
