r78726 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78725‎ | r78726 | r78727 >
Date:19:48, 21 December 2010
Author:reedy
Status:ok
Tags:
Comment:
Add getQueryInfo, replacing getSQL
Modified paths:
  • /branches/querypage-work2/extensions/MetavidWiki/includes/specials/MV_SpecialListStreams.php (modified) (history)

Diff [purge]

Index: branches/querypage-work2/extensions/MetavidWiki/includes/specials/MV_SpecialListStreams.php
@@ -45,9 +45,9 @@
4646 function getPageHeader() {
4747 return '<p>' . wfMsg( 'mv_list_streams_docu' ) . "</p><br />\n";
4848 }
49 - function getSQL() {
50 - $dbr = wfGetDB( DB_SLAVE );
51 - // $relations = $dbr->tableName( 'smw_relations' );
 49+
 50+ function getQueryInfo() {
 51+ // $relations = $dbr->tableName( 'smw_relations' );
5252 // $NSrel = SMW_NS_RELATION;
5353 # QueryPage uses the value from this SQL in an ORDER clause.
5454 /*return "SELECT 'Relations' as type,
@@ -63,13 +63,13 @@
6464 * stream length
6565 * formats available
6666 * number of associative metadata chunks */
67 - return "SELECT
68 - `id` as `stream_id`,
69 - `name` as title,
70 - `name` as value " .
71 - "FROM " . $dbr->tableName( 'mv_streams' );
7267
 68+ return array(
 69+ 'tables' => array( 'mv_streams' ),
 70+ 'fields' => array( 'id AS stream_id', 'name AS title', 'name AS value' )
 71+ );
7372 }
 73+
7474 function getOrder() {
7575 return ' ORDER BY `mv_streams`.`date_start_time` DESC ';
7676 // ($this->sortDescending() ? 'DESC' : '');

Status & tagging log