* For back-compat, subclasses may return a raw SQL query here, as a string.
* This is stronly deprecated; getQueryInfo() should be overridden instead.
* @return string
- * @deprecated since 1.18
*/
function getSQL() {
+ /* Implement getQueryInfo() instead */
throw new MWException( "Bug in a QueryPage: doesn't implement getQueryInfo() nor getQuery() properly" );
}
if ( $offset !== false ) {
$options['OFFSET'] = intval( $offset );
}
+ if ( $this->sortDescending() ) {
+ $options['ORDER BY'] = 'qc_value DESC';
+ } else {
+ $options['ORDER BY'] = 'qc_value ASC';
+ }
$res = $dbr->select( 'querycache', array( 'qc_type',
'qc_namespace AS namespace',
'qc_title AS title',
);
return $dbr->resultObject( $res );
}
-
+
public function getCachedTimestamp() {
if ( !is_null( $this->cachedTimestamp ) ) {
$dbr = wfGetDB( DB_SLAVE );