r40324 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40323‎ | r40324 | r40325 >
Date:15:50, 2 September 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
updated documentation
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_QueryResult.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_QueryResult.php
@@ -45,7 +45,7 @@
4646 /**
4747 * Checks whether it conforms to the given schema of print requests, adds the
4848 * row to the result, and returns true. Otherwise returns false.
49 - * TODO: should we just skip the checks and trust our callers?
 49+ * @todo Should we just skip the checks and trust our callers?
5050 */
5151 public function addRow($row) {
5252 reset($row);
@@ -177,7 +177,7 @@
178178 * Return URL of a page that displays those search results
179179 * (and enables browsing results, and is accessible even without
180180 * JavaScript enabled browsers).
181 - * @deprecated use SMWQueryResult::getQueryLink() in SMW >1.1
 181+ * @deprecated Use SMWQueryResult::getQueryLink() in SMW >1.1. This method will last be available in SMW 1.3 and vanish thereafter.
182182 */
183183 public function getQueryURL() {
184184 $title = Title::makeTitle(NS_SPECIAL, 'ask');
@@ -206,7 +206,7 @@
207207 * Return titlestring of a page that displays those search results
208208 * (and enables browsing results, and is accessible even without
209209 * JavaScript enabled browsers).
210 - * @deprecated use SMWQueryResult::getQueryLink() in SMW >1.1
 210+ * @deprecated use SMWQueryResult::getQueryLink() in SMW >1.1. This method will last be available in SMW 1.3 and vanish thereafter.
211211 */
212212 public function getQueryTitle($prefixed = true) {
213213 if ($prefixed) {
@@ -243,8 +243,7 @@
244244
245245 /**
246246 * Container for the contents of a single result field of a query result,
247 - * i.e. basically an array of Titles or SMWDataValues with some additional
248 - * parameters.
 247+ * i.e. basically an array of SMWDataValues with some additional parameters.
249248 */
250249 class SMWResultArray {
251250 protected $printrequest;
@@ -277,41 +276,59 @@
278277
279278 /**
280279 * Return the main text representation of the next result object
281 - * (Title or SMWDataValue) as HTML.
 280+ * (Title or SMWDataValue) in the specified format.
282281 *
283282 * The parameter $linker controls linking of title values and should
284 - * be some Linker object (or NULL for no linking).
285 - * @deprecated Use SMWResultArray::getNextText()
 283+ * be some Linker object (or NULL for no linking). At some stage its
 284+ * interpretation should be part of the generalised SMWDataValue.
286285 */
287 - public function getNextHTMLText($linker = NULL) {
 286+ public function getNextText($outputmode, $linker = NULL) {
288287 $object = current($this->content);
289288 next($this->content);
290289 if ($object instanceof SMWDataValue) { //print data values
291290 if ($object->getTypeID() == '_wpg') { // prefer "long" text for page-values
292 - return $object->getLongHTMLText($linker);
 291+ return $object->getLongText($outputmode, $linker);
293292 } else {
294 - return $object->getShortHTMLText($linker);
 293+ return $object->getShortText($outputmode, $linker);
295294 }
296295 } else {
297296 return false;
298297 }
299298 }
300299
 300+
301301 /**
 302+ * Would there be more query results that were
 303+ * not shown due to a limit?
 304+ */
 305+ public function hasFurtherResults() {
 306+ return $this->furtherres;
 307+ }
 308+
 309+ /**
 310+ * Return an SMWPrintRequest object describing what is contained in this
 311+ * result set.
 312+ */
 313+ public function getPrintRequest() {
 314+ return $this->printrequest;
 315+ }
 316+
 317+ /**
302318 * Return the main text representation of the next result object
303 - * (Title or SMWDataValue) as Wikitext. The parameter $linked controls
304 - * linking of title values and should be non-NULL and non-false if this
305 - * is desired.
306 - * @deprecated Use SMWResultArray::getNextText()
 319+ * (Title or SMWDataValue) as HTML.
 320+ *
 321+ * The parameter $linker controls linking of title values and should
 322+ * be some Linker object (or NULL for no linking).
 323+ * @deprecated Use SMWResultArray::getNextText(). This method will last be available in SMW 1.3 and vanish thereafter.
307324 */
308 - public function getNextWikiText($linked = NULL) {
 325+ public function getNextHTMLText($linker = NULL) {
309326 $object = current($this->content);
310327 next($this->content);
311328 if ($object instanceof SMWDataValue) { //print data values
312329 if ($object->getTypeID() == '_wpg') { // prefer "long" text for page-values
313 - return $object->getLongWikiText($linked);
 330+ return $object->getLongHTMLText($linker);
314331 } else {
315 - return $object->getShortWikiText($linked);
 332+ return $object->getShortHTMLText($linker);
316333 }
317334 } else {
318335 return false;
@@ -320,41 +337,24 @@
321338
322339 /**
323340 * Return the main text representation of the next result object
324 - * (Title or SMWDataValue) in the specified format.
325 - *
326 - * The parameter $linker controls linking of title values and should
327 - * be some Linker object (or NULL for no linking). At some stage its
328 - * interpretation should be part of the generalised SMWDataValue.
 341+ * (Title or SMWDataValue) as Wikitext. The parameter $linked controls
 342+ * linking of title values and should be non-NULL and non-false if this
 343+ * is desired.
 344+ * @deprecated Use SMWResultArray::getNextText(). This method will last be available in SMW 1.3 and vanish thereafter.
329345 */
330 - public function getNextText($outputmode, $linker = NULL) {
 346+ public function getNextWikiText($linked = NULL) {
331347 $object = current($this->content);
332348 next($this->content);
333349 if ($object instanceof SMWDataValue) { //print data values
334350 if ($object->getTypeID() == '_wpg') { // prefer "long" text for page-values
335 - return $object->getLongText($outputmode, $linker);
 351+ return $object->getLongWikiText($linked);
336352 } else {
337 - return $object->getShortText($outputmode, $linker);
 353+ return $object->getShortWikiText($linked);
338354 }
339355 } else {
340356 return false;
341357 }
342358 }
343359
344 -
345 - /**
346 - * Would there be more query results that were
347 - * not shown due to a limit?
348 - */
349 - public function hasFurtherResults() {
350 - return $this->furtherres;
351 - }
352 -
353 - /**
354 - * Return an SMWPrintRequest object describing what is contained in this
355 - * result set.
356 - */
357 - public function getPrintRequest() {
358 - return $this->printrequest;
359 - }
360360 }
361361

Status & tagging log