Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php |
— | — | @@ -807,5 +807,19 @@ |
808 | 808 | public function getUnit() { |
809 | 809 | return ''; // empty unit |
810 | 810 | } |
| 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 | + } |
811 | 825 | |
812 | 826 | } |
\ No newline at end of file |