Пример #1
0
 function getUserEvents($all = false)
 {
     $cond = new Conditions();
     $per_page = 0;
     if (isset($this->params['per_page'])) {
         $per_page = (int) $this->params['per_page'];
     }
     $per_page = $per_page > 0 ? $per_page : self::PER_PAGE;
     $pagingName = isset($this->params['paging_parameter_name']) ? $this->params['paging_parameter_name'] : 'p';
     $cond->setPaging(self::MAX_EVENTS_ON_WALL, $per_page, $pagingName);
     $limit = $cond->getMongoLimit();
     // показываем просто последнюю активность
     $events = MongoDatabase::findReviewEvents(false, $this->user_id, $per_page, $limit);
     $this->_list($events);
 }
Пример #2
0
 function getReviews()
 {
     $res = MongoDatabase::findReviewEvents($this->target_id);
     $this->data = $this->_list($res, $uids = array());
     $this->data['reviews']['target_id'] = $this->target_id;
     $this->data['reviews']['target_type'] = $this->target_type;
 }