/** * Browse Albums. */ protected function _actionBrowse($context) { $sets = parent::_actionBrowse($context); $sets->order('updateTime', 'DESC'); if ($this->photo_id && $this->getRequest()->get('layout') != 'selector') { $sets->where('photos.id', '=', $this->photo_id); } return $sets; }
/** * Browse Todos * * @param KCommandContext $context * @return void */ protected function _actionBrowse($context) { if (!$context->query) { $context->query = $this->getRepository()->getQuery(); } $query = $context->query; $query->order('open', 'DESC'); if ($this->sort == 'priority') { $query->order('priority', 'DESC'); } return parent::_actionBrowse($context); }
/** * Browse Photos * * @param KCommandContext $context * @return void */ protected function _actionBrowse($context) { $this->getService('repos://site/photos.set'); $photos = parent::_actionBrowse($context); $photos->order('creationTime', 'DESC'); if ($this->exclude_set != '') { $set = $this->actor->sets->fetch(array('id' => $this->exclude_set)); if (!empty($set)) { $photo_ids = array(); foreach ($set->photos as $photo) { $photo_ids[] = $photo->id; } if (count($photo_ids)) { $photos->where('photo.id', '<>', $photo_ids); } } } return $photos; }
/** * Browse Topics. * * @param KCommandContext $context Context */ protected function _actionBrowse($context) { $topics = parent::_actionBrowse($context); $topics->order('IF(@col(lastCommentTime) IS NULL, @col(creationTime), @col(lastCommentTime))', 'DESC'); }