1 | <?php |
||
6 | class ConceptProperty |
||
7 | { |
||
8 | /** stores the property type */ |
||
9 | private $prop; |
||
10 | /** stores the property supertype */ |
||
11 | private $super; |
||
12 | /** stores the property label */ |
||
13 | private $label; |
||
14 | /** stores the property tooltip */ |
||
15 | private $tooltip; |
||
16 | /** stores the property values */ |
||
17 | private $values; |
||
18 | /** flag whether the values are sorted, as we do lazy sorting */ |
||
19 | private $is_sorted; |
||
20 | private $sort_by_notation; |
||
21 | |||
22 | /** |
||
23 | * Label parameter seems to be optional in this phase. |
||
24 | * @param string $prop property type eg. 'rdf:type'. |
||
25 | * @param string $label property label |
||
26 | * @param string $tooltip property tooltip/description |
||
27 | * @param string $super URI of superproperty |
||
28 | * @param boolean $sort_by_notation whether to sort the property values by their notation code |
||
29 | */ |
||
30 | public function __construct($prop, $label, $tooltip=null, $super=null, $sort_by_notation=false) |
||
40 | |||
41 | /** |
||
42 | * Gets the gettext translation for a property or returns the identifier as a fallback. |
||
43 | */ |
||
44 | public function getLabel() |
||
63 | |||
64 | /** |
||
65 | * Returns an alphanumeric ID for the property, suitable for use as a CSS identifier. |
||
66 | */ |
||
67 | public function getID() |
||
71 | |||
72 | /** |
||
73 | * Returns text for the property tooltip. |
||
74 | * @return string |
||
75 | */ |
||
76 | public function getDescription() |
||
94 | |||
95 | /** |
||
96 | * Returns an array of the property values. |
||
97 | * @return ConceptMappingPropertyValue[] |
||
98 | */ |
||
99 | public function getValues() |
||
106 | |||
107 | public function addValue($value) |
||
112 | |||
113 | private function sortValues() |
||
147 | |||
148 | /** |
||
149 | * Returns property type as a string. |
||
150 | * @return string eg. 'rdf:type'. |
||
151 | */ |
||
152 | public function getType() |
||
156 | |||
157 | /** |
||
158 | * Returns property supertype (?property skos:subPropertyOf ?super) as a string. |
||
159 | * @return string eg. 'skos:hiddenLabel'. |
||
160 | */ |
||
161 | public function getSubPropertyOf() |
||
165 | } |
||
166 |