r55878 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55877‎ | r55878 | r55879 >
Date:14:50, 6 September 2009
Author:mkroetzsch
Status:deferred
Tags:
Comment:
some simplifications
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_QueryResult.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_QueryResult.php
@@ -25,9 +25,6 @@
2626 protected $m_furtherres; // are there more results than the ones given?
2727 // The following are not part of the result, but specify the input query (needed for further results link):
2828 protected $m_query; // the query object, must be set on create and is our fallback for all other data
29 - protected $m_querystring; // string (inline query) version of query
30 - protected $m_extraprintouts; // the additional SMWPrintRequest objects specified outside $m_querystring
31 - // Note: these may differ from m_printrequests, since they do not involve requests given in the querystring
3229
3330 /**
3431 * Initialise the object with an array of SMWPrintRequest objects, which
@@ -38,8 +35,6 @@
3936 $this->m_printrequests = $printrequests;
4037 $this->m_furtherres = $furtherres;
4138 $this->m_query = $query;
42 - $this->m_querystring = $query->getQueryString();
43 - $this->m_extraprintouts = $query->getExtraPrintouts();
4439 }
4540
4641 /**
@@ -74,8 +69,7 @@
7570
7671
7772 /**
78 - * Return the next result row as an array of
79 - * SMWResultArray objects.
 73+ * Return the next result row as an array of SMWResultArray objects.
8074 */
8175 public function getNext() {
8276 $result = current($this->m_content);
@@ -111,7 +105,7 @@
112106 * returned.
113107 */
114108 public function getQueryString() {
115 - return $this->m_querystring;
 109+ return $this->m_query->getQueryString();
116110 }
117111
118112 /**
@@ -142,8 +136,8 @@
143137 * message 'smw_iq_moreresults' is used as a caption.
144138 */
145139 public function getQueryLink($caption = false) {
146 - $params = array(trim($this->m_querystring));
147 - foreach ($this->m_extraprintouts as $printout) {
 140+ $params = array(trim($this->m_query->getQueryString()));
 141+ foreach ($this->m_query->getExtraPrintouts() as $printout) {
148142 $params[] = $printout->getSerialisation();
149143 }
150144 if ( count($this->m_query->sortkeys)>0 ) {
@@ -234,8 +228,7 @@
235229
236230
237231 /**
238 - * Would there be more query results that were
239 - * not shown due to a limit?
 232+ * Would there be more query results that were not shown due to a limit?
240233 */
241234 public function hasFurtherResults() {
242235 return $this->furtherres;

Status & tagging log