public function execute() { $params = $this->extractRequestParams(); $prop = array_flip($params['prop']); $this->fld_displayname = isset($prop['displayname']); $this->fld_description = isset($prop['description']); $this->fld_hitcount = isset($prop['hitcount']); $this->limit = $params['limit']; $this->result = $this->getResult(); $this->addTables('change_tag'); $this->addFields('ct_tag'); $this->addFieldsIf(array('hitcount' => 'COUNT(*)'), $this->fld_hitcount); $this->addOption('LIMIT', $this->limit + 1); $this->addOption('GROUP BY', 'ct_tag'); $this->addWhereRange('ct_tag', 'newer', $params['continue'], null); $res = $this->select(__METHOD__); $ok = true; foreach ($res as $row) { if (!$ok) { break; } $ok = $this->doTag($row->ct_tag, $this->fld_hitcount ? $row->hitcount : 0); } // include tags with no hits yet foreach (ChangeTags::listDefinedTags() as $tag) { if (!$ok) { break; } $ok = $this->doTag($tag, 0); } $this->result->setIndexedTagName_internal(array('query', $this->getModuleName()), 'tag'); }