$res = $this->select(__METHOD__);
- $data = array ();
+ $pageids = array ();
$count = 0;
+ $result = $this->getResult();
while ($row = $db->fetchObject($res)) {
if (++ $count > $limit) {
// We've reached the one extra which shows that there are additional pages to be had. Stop here...
$vals['fromid'] = intval($row->pl_from);
if ($fld_title) {
$title = Title :: makeTitle($params['namespace'], $row->pl_title);
- $vals['ns'] = intval($title->getNamespace());
- $vals['title'] = $title->getPrefixedText();
+ ApiQueryBase::addTitleInfo($vals, $title);
+ }
+ $fit = $result->addValue(array('query', $this->getModuleName()), null, $vals);
+ if(!$fit)
+ {
+ if($params['unique'])
+ $this->setContinueEnumParameter('from', $this->keyToTitle($row->pl_title));
+ else
+ $this->setContinueEnumParameter('continue', $this->keyToTitle($row->pl_title) . "|" . $row->pl_from);
+ break;
}
- $data[] = $vals;
} else {
$pageids[] = $row->pl_from;
}
$db->freeResult($res);
if (is_null($resultPageSet)) {
- $result = $this->getResult();
- $result->setIndexedTagName($data, 'l');
- $result->addValue('query', $this->getModuleName(), $data);
+ $result->setIndexedTagName_internal(array('query', $this->getModuleName()), 'l');
} else {
$resultPageSet->populateFromPageIDs($pageids);
}
public function getVersion() {
return __CLASS__ . ': $Id$';
}
-}
+}
\ No newline at end of file