/**
* This is a base class for all Query modules.
* It provides some common functionality such as constructing various SQL queries.
- *
+ *
* @addtogroup API
*/
abstract class ApiQueryBase extends ApiBase {
if (!is_null($end))
$this->addWhere($field . $before . $db->addQuotes($end));
-
+
$order = $field . ($isDirNewer ? '' : ' DESC');
if (!isset($this->options['ORDER BY']))
$this->addOption('ORDER BY', $order);
$this->profileDBIn();
$rowcount = $db->estimateRowCount($this->tables, $this->fields, $this->where, __METHOD__, $this->options);
$this->profileDBOut();
-
+
global $wgAPIMaxDBRows;
if($rowcount > $wgAPIMaxDBRows)
return false;
$arr[$prefix . 'ns'] = intval($title->getNamespace());
$arr[$prefix . 'title'] = $title->getPrefixedText();
}
-
+
/**
* Override this method to request extra fields from the pageSet
* using $pageSet->requestField('fieldName')
}
/**
- * Add sub-element under the page element with the given pageId.
+ * Add sub-element under the page element with the given pageId.
*/
protected function addPageSubItems($pageId, $data) {
$result = $this->getResult();
}
protected function setContinueEnumParameter($paramName, $paramValue) {
-
+
$paramName = $this->encodeParamName($paramName);
$msg = array( $paramName => $paramValue );
// This is an alternative continue format as a part of the URL string
// ApiResult :: setContent($msg, $paramName . '=' . urlencode($paramValue));
-
+
$this->getResult()->addValue('query-continue', $this->getModuleName(), $msg);
}
/**
* Selects the query database connection with the given name.
- * If no such connection has been requested before, it will be created.
- * Subsequent calls with the same $name will return the same connection
- * as the first, regardless of $db or $groups new values.
+ * If no such connection has been requested before, it will be created.
+ * Subsequent calls with the same $name will return the same connection
+ * as the first, regardless of $db or $groups new values.
*/
public function selectNamedDB($name, $db, $groups) {
- $this->mDb = $this->getQuery()->getNamedDB($name, $db, $groups);
+ $this->mDb = $this->getQuery()->getNamedDB($name, $db, $groups);
}
/**
}
return false;
}
-
+
public static function getBaseVersion() {
return __CLASS__ . ': $Id$';
}
*/
public abstract function executeGenerator($resultPageSet);
}
-