protected function _actionBrowse($context)
    {
        $this->actor->resetNotifications();

        if ($this->actor->eql(get_viewer())) {
            $title = AnTranslator::_('COM-NOTIFICATIONS-ACTORBAR-YOUR-NOTIFICATIONS');
        } else {
            $title = sprintf(AnTranslator::_('COM-NOTIFICATIONS-ACTORBAR-ACTOR-NOTIFICATIONS'), $this->actor->name);
        }

        $this->getToolbar('actorbar')->setTitle($title);

        $entities = parent::_actionBrowse($context);

        $entities
        ->where('notification.story_subject_id', '<>', $this->actor->id)
        ->clause('AND')
        ->where('notification.story_target_id', '=', $this->actor->id)
        ->where('notification.story_object_id', '=', $this->actor->id, 'OR')
        ->where('FIND_IN_SET('.$this->actor->id.', notification.subscriber_ids)', 'OR')
        ;

        if ($this->new) {
            $entities->id($this->actor->newNotificationIds->toArray());
        }

        //only zero the notifications if the viewer is the same as the
        //actor. prevents from admin zeroing others notifications
        if ($entities->count() > 0 && get_viewer()->eql($this->actor)) {
            //set the number of notification, since it's going to be
            AnService::setConfig('com:viewer.html', array('data' => array('num_notifications' => $this->actor->numOfNewNotifications())));
            $this->registerCallback('after.get', array($this->actor, 'viewedNotifications'), $entities->toArray());
        }

        return $entities;
    }
protected function _actionBrowse($context)
    {
        $this->actor->resetNotifications();

        if ($this->actor->eql(get_viewer())) {
            $title = AnTranslator::_('COM-NOTIFICATIONS-ACTORBAR-YOUR-NOTIFICATIONS');
        } else {
            $title = sprintf(AnTranslator::_('COM-NOTIFICATIONS-ACTORBAR-ACTOR-NOTIFICATIONS'), $this->actor->name);
        }

        $this->getToolbar('actorbar')->setTitle($title);

        $entities = parent::_actionBrowse($context);

        $entities
        ->where('notification.story_subject_id', '<>', $this->actor->id)
        ->clause('AND')
        ->where('notification.story_target_id', '=', $this->actor->id)
        ->where('notification.story_object_id', '=', $this->actor->id, 'OR')
        ->where('FIND_IN_SET('.$this->actor->id.', notification.subscriber_ids)', 'OR')
        ;

        if ($this->new) {
            $entities->id($this->actor->newNotificationIds->toArray());
        }

        //only zero the notifications if the viewer is the same as the
        //actor. prevents from admin zeroing others notifications
        if ($entities->count() > 0 && get_viewer()->eql($this->actor)) {
            //set the number of notification, since it's going to be
            AnService::setConfig('com:viewer.html', array('data' => array('num_notifications' => $this->actor->numOfNewNotifications())));
            $this->registerCallback('after.get', array($this->actor, 'viewedNotifications'), $entities->toArray());
        }

        return $entities;
    }
protected function _actionBrowse ( $ context ) { $ this -> actor -> resetNotifications ( ) ; if ( $ this -> actor -> eql ( get_viewer ( ) ) ) { $ title = AnTranslator :: _ ( 'COM-NOTIFICATIONS-ACTORBAR-YOUR-NOTIFICATIONS' ) ; } else { $ title = sprintf ( AnTranslator :: _ ( 'COM-NOTIFICATIONS-ACTORBAR-ACTOR-NOTIFICATIONS' ) , $ this -> actor -> name ) ; } $ this -> getToolbar ( 'actorbar' ) -> setTitle ( $ title ) ; $ entities = parent :: _actionBrowse ( $ context ) ; $ entities -> where ( 'notification.story_subject_id' , '<>' , $ this -> actor -> id ) -> clause ( 'AND' ) -> where ( 'notification.story_target_id' , '=' , $ this -> actor -> id ) -> where ( 'notification.story_object_id' , '=' , $ this -> actor -> id , 'OR' ) -> where ( 'FIND_IN_SET(' . $ this -> actor -> id . ', notification.subscriber_ids)' , 'OR' ) ; if ( $ this -> new ) { $ entities -> id ( $ this -> actor -> newNotificationIds -> toArray ( ) ) ; } //only zero the notifications if the viewer is the same as the //actor. prevents from admin zeroing others notifications if ( $ entities -> count ( ) > 0 && get_viewer ( ) -> eql ( $ this -> actor ) ) { //set the number of notification, since it's going to be AnService :: setConfig ( 'com:viewer.html' , array ( 'data' => array ( 'num_notifications' => $ this -> actor -> numOfNewNotifications ( ) ) ) ) ; $ this -> registerCallback ( 'after.get' , array ( $ this -> actor , 'viewedNotifications' ) , $ entities -> toArray ( ) ) ; } return $ entities ; }
Return a set of notification objects.

@param AnCommandContext $context Context parameter

@return AnDomainEntitysetDefault
Return a set of notification objects .