r81794 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81793‎ | r81794 | r81795 >
Date:23:31, 8 February 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added method that allows result printers to distinguise between the subject object and objects that are properties
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php
@@ -807,5 +807,19 @@
808808 public function getUnit() {
809809 return ''; // empty unit
810810 }
 811+
 812+ /**
 813+ * Returns if the data value holds info about a main object (page)
 814+ * or not (property). This allows query printers to distinguise
 815+ * the main object from properties of type page (count does not
 816+ * suffice as the main object can be omitted using mainlabel=-)
 817+ *
 818+ * @since 1.5.6
 819+ *
 820+ * @return boolean
 821+ */
 822+ public function isMainObject() {
 823+ return $this->m_property == null;
 824+ }
811825
812826 }
\ No newline at end of file

Status & tagging log