r65788 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65787‎ | r65788 | r65789 >
Date:06:26, 2 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Randomly improved some php docs
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php
@@ -2,8 +2,10 @@
33 /**
44 * This file contains basic classes for representing (query) descriptions in
55 * the SMW API.
 6+ *
67 * @file
78 * @ingroup SMWQuery
 9+ *
810 * @author Markus Krötzsch
911 */
1012
@@ -20,6 +22,8 @@
2123 /**
2224 * Get the (possibly empty) array of all print requests that
2325 * exist for the entities that fit this description.
 26+ *
 27+ * @return array
2428 */
2529 public function getPrintRequests() {
2630 return $this->m_printreqs;
@@ -27,11 +31,18 @@
2832
2933 /**
3034 * Set the array of print requests completely.
 35+ *
 36+ * @param array $printrequests
3137 */
32 - public function setPrintRequests( $printrequests ) {
 38+ public function setPrintRequests( array $printrequests ) {
3339 $this->m_printreqs = $printrequests;
3440 }
3541
 42+ /**
 43+ * Add a single SMWPrintRequest.
 44+ *
 45+ * @param SMWPrintRequest $printrequest
 46+ */
3647 public function addPrintRequest( SMWPrintRequest $printrequest ) {
3748 $this->m_printreqs[$printrequest->getHash()] = $printrequest;
3849 }
@@ -39,6 +50,8 @@
4051 /**
4152 * Add a new print request, but at the beginning of the list of requests
4253 * (thus it will be printed first).
 54+ *
 55+ * @param SMWPrintRequest
4356 */
4457 public function prependPrintRequest( SMWPrintRequest $printrequest ) {
4558 $this->m_printreqs = array_merge( array( $printrequest->getHash() => $printrequest ), $this->m_printreqs );
@@ -49,20 +62,27 @@
5063 * Some descriptions have different syntax in property value positions. The
5164 * parameter $asvalue specifies whether the serialisation should take that into
5265 * account.
 66+ *
5367 * Example: The SMWValueDescription [[Paris]] returns the single result "Paris"
5468 * but can also be used as value in [[has location::Paris]] which is preferred
5569 * over the canonical [[has location::\<q\>[[Paris]]\</q\>]].
 70+ *
 71+ * @param boolean $asvalue
5672 */
5773 abstract public function getQueryString( $asvalue = false );
5874
5975 /**
6076 * Return true if the description is required to encompass at most a single
6177 * result, independently of the knowledge base.
 78+ *
 79+ * @return boolean
6280 */
6381 abstract public function isSingleton();
6482
6583 /**
6684 * Compute the size of the decription. Default is 1.
 85+ *
 86+ * @return integer
6787 */
6888 public function getSize() {
6989 return 1;
@@ -70,6 +90,8 @@
7191
7292 /**
7393 * Compute the depth of the decription. Default is 0.
 94+ *
 95+ * @return integer
7496 */
7597 public function getDepth() {
7698 return 0;
@@ -88,6 +110,8 @@
89111 * Most descriptins can only describe wiki pages, so this is the default,
90112 * but some descriptions may refer to other datatypes, and overwrite this
91113 * function accordingly.
 114+ *
 115+ * @return string
92116 */
93117 public function getTypeID() {
94118 return '_wpg';
@@ -100,6 +124,7 @@
101125 * Default implementation for non-nested descriptions of size 1.
102126 * The parameter $log contains a list of all pruned conditions, updated when some
103127 * description was reduced.
 128+ *
104129 * @note Objects must not do changes on $this during pruning, since $this can be
105130 * reused in multiple places of one or many queries. Make new objects to reflect
106131 * changes!

Status & tagging log