protected function _actionBrowse(AnCommandContext $context)
     {
         $entities = parent::_actionBrowse($context);

         if ($this->filter == 'leaders') {
             $ids = get_viewer()->leaderIds->toArray();
             $ids[] = get_viewer()->id;
             $entities->where('owner.id', 'IN', $ids);
         } else {
             $entities->owner($this->actor);
         }

         $entities->aggregateKeys($this->getService('com:stories.domain.aggregations'));
         
         $entities->order('creationTime', 'desc');

         if ($this->component) {
             $entities->clause()->component((array) AnConfig::unbox($this->component));
         }

         if ($this->name) {
             $entities->clause()->name((array) AnConfig::unbox($this->name));
         }

         if ($this->subject) {
             $entities->clause()->where('subject.id', 'IN', (array) AnConfig::unbox($this->subject));
         }

         return $this->setList($entities)->getList();
     }
protected function _actionBrowse(AnCommandContext $context)
     {
         $entities = parent::_actionBrowse($context);

         if ($this->filter == 'leaders') {
             $ids = get_viewer()->leaderIds->toArray();
             $ids[] = get_viewer()->id;
             $entities->where('owner.id', 'IN', $ids);
         } else {
             $entities->owner($this->actor);
         }

         $entities->aggregateKeys($this->getService('com:stories.domain.aggregations'));
         
         $entities->order('creationTime', 'desc');

         if ($this->component) {
             $entities->clause()->component((array) AnConfig::unbox($this->component));
         }

         if ($this->name) {
             $entities->clause()->name((array) AnConfig::unbox($this->name));
         }

         if ($this->subject) {
             $entities->clause()->where('subject.id', 'IN', (array) AnConfig::unbox($this->subject));
         }

         return $this->setList($entities)->getList();
     }
protected function _actionBrowse ( AnCommandContext $ context ) { $ entities = parent :: _actionBrowse ( $ context ) ; if ( $ this -> filter == 'leaders' ) { $ ids = get_viewer ( ) -> leaderIds -> toArray ( ) ; $ ids [ ] = get_viewer ( ) -> id ; $ entities -> where ( 'owner.id' , 'IN' , $ ids ) ; } else { $ entities -> owner ( $ this -> actor ) ; } $ entities -> aggregateKeys ( $ this -> getService ( 'com:stories.domain.aggregations' ) ) ; $ entities -> order ( 'creationTime' , 'desc' ) ; if ( $ this -> component ) { $ entities -> clause ( ) -> component ( ( array ) AnConfig :: unbox ( $ this -> component ) ) ; } if ( $ this -> name ) { $ entities -> clause ( ) -> name ( ( array ) AnConfig :: unbox ( $ this -> name ) ) ; } if ( $ this -> subject ) { $ entities -> clause ( ) -> where ( 'subject.id' , 'IN' , ( array ) AnConfig :: unbox ( $ this -> subject ) ) ; } return $ this -> setList ( $ entities ) -> getList ( ) ; }
Browse action.

@param AnCommandContext $context Context parameter
Browse action .