1 | <?php |
||
26 | class Property implements |
||
27 | StatementListProvidingEntity, |
||
28 | FingerprintProvider, |
||
29 | StatementListHolder, |
||
|
|||
30 | LabelsProvider, |
||
31 | DescriptionsProvider, |
||
32 | AliasesProvider, |
||
33 | ClearableEntity |
||
34 | { |
||
35 | |||
36 | public const ENTITY_TYPE = 'property'; |
||
37 | |||
38 | /** |
||
39 | * @var PropertyId|null |
||
40 | */ |
||
41 | private $id; |
||
42 | |||
43 | /** |
||
44 | * @var Fingerprint |
||
45 | */ |
||
46 | private $fingerprint; |
||
47 | |||
48 | /** |
||
49 | * @var string The data type of the property. |
||
50 | */ |
||
51 | private $dataTypeId; |
||
52 | |||
53 | 69 | /** |
|
54 | * @var StatementList |
||
55 | */ |
||
56 | private $statements; |
||
57 | |||
58 | /** |
||
59 | 69 | * @since 1.0 |
|
60 | 69 | * |
|
61 | 69 | * @param PropertyId|null $id |
|
62 | 68 | * @param Fingerprint|null $fingerprint |
|
63 | 68 | * @param string $dataTypeId The data type of the property. Not to be confused with the data |
|
64 | * value type. |
||
65 | * @param StatementList|null $statements Since 1.1 |
||
66 | */ |
||
67 | public function __construct( |
||
78 | |||
79 | /** |
||
80 | * Returns the id of the entity or null if it does not have one. |
||
81 | * |
||
82 | * @since 0.1 return type changed in 0.3 |
||
83 | * |
||
84 | * @return PropertyId|null |
||
85 | 4 | */ |
|
86 | 4 | public function getId() { |
|
89 | 3 | ||
90 | 3 | /** |
|
91 | * @since 0.5, can be null since 1.0 |
||
92 | * |
||
93 | * @param PropertyId|null $id |
||
94 | 4 | * |
|
95 | * @throws InvalidArgumentException |
||
96 | */ |
||
97 | public function setId( $id ) { |
||
104 | |||
105 | /** |
||
106 | * @since 0.7.3 |
||
107 | * |
||
108 | * @return Fingerprint |
||
109 | */ |
||
110 | 3 | public function getFingerprint() { |
|
113 | |||
114 | /** |
||
115 | * @since 0.7.3 |
||
116 | * |
||
117 | * @param Fingerprint $fingerprint |
||
118 | */ |
||
119 | public function setFingerprint( Fingerprint $fingerprint ) { |
||
122 | 12 | ||
123 | /** |
||
124 | * @see LabelsProvider::getLabels |
||
125 | * |
||
126 | * @since 6.0 |
||
127 | * |
||
128 | * @return TermList |
||
129 | */ |
||
130 | 11 | public function getLabels() { |
|
133 | |||
134 | /** |
||
135 | * @see DescriptionsProvider::getDescriptions |
||
136 | * |
||
137 | * @since 6.0 |
||
138 | * |
||
139 | * @return TermList |
||
140 | 31 | */ |
|
141 | 31 | public function getDescriptions() { |
|
144 | |||
145 | /** |
||
146 | * @see AliasesProvider::getAliasGroups |
||
147 | * |
||
148 | * @since 6.0 |
||
149 | * |
||
150 | * @return AliasGroupList |
||
151 | 69 | */ |
|
152 | 69 | public function getAliasGroups() { |
|
155 | |||
156 | 68 | /** |
|
157 | 68 | * @param string $languageCode |
|
158 | * @param string $value |
||
159 | * |
||
160 | * @throws InvalidArgumentException |
||
161 | */ |
||
162 | public function setLabel( $languageCode, $value ) { |
||
165 | 4 | ||
166 | /** |
||
167 | * @param string $languageCode |
||
168 | * @param string $value |
||
169 | * |
||
170 | * @throws InvalidArgumentException |
||
171 | */ |
||
172 | public function setDescription( $languageCode, $value ) { |
||
175 | |||
176 | /** |
||
177 | * @param string $languageCode |
||
178 | * @param string[] $aliases |
||
179 | * |
||
180 | * @throws InvalidArgumentException |
||
181 | */ |
||
182 | public function setAliases( $languageCode, array $aliases ) { |
||
185 | |||
186 | 66 | /** |
|
187 | 66 | * @since 0.4 |
|
188 | * |
||
189 | * @param string $dataTypeId The data type of the property. Not to be confused with the data |
||
190 | * value type. |
||
191 | * |
||
192 | * @throws InvalidArgumentException |
||
193 | */ |
||
194 | public function setDataTypeId( $dataTypeId ) { |
||
201 | |||
202 | /** |
||
203 | * @since 0.4 |
||
204 | 18 | * |
|
205 | 18 | * @return string Returns the data type of the property (property type). Not to be confused with |
|
206 | * the data value type. |
||
207 | */ |
||
208 | public function getDataTypeId() { |
||
211 | 18 | ||
212 | 18 | /** |
|
213 | * @see Entity::getType |
||
214 | * |
||
215 | * @since 0.1 |
||
216 | * |
||
217 | * @return string Returns the entity type "property". |
||
218 | */ |
||
219 | public function getType() { |
||
222 | |||
223 | 4 | /** |
|
224 | 4 | * @since 0.3 |
|
225 | 4 | * |
|
226 | * @param string $dataTypeId The data type of the property. Not to be confused with the data |
||
227 | * value type. |
||
228 | * |
||
229 | * @return self |
||
230 | */ |
||
231 | public static function newFromType( $dataTypeId ) { |
||
234 | 1 | ||
235 | 1 | /** |
|
236 | 1 | * @see EntityDocument::equals |
|
237 | * |
||
238 | * @since 0.1 |
||
239 | * |
||
240 | * @param mixed $target |
||
241 | * |
||
242 | * @return bool |
||
243 | 5 | */ |
|
244 | 5 | public function equals( $target ) { |
|
254 | 2 | ||
255 | /** |
||
256 | * Returns if the Property has no content. |
||
257 | * Having an id and type set does not count as having content. |
||
258 | * |
||
259 | * @since 0.1 |
||
260 | * |
||
261 | 4 | * @return bool |
|
262 | 4 | */ |
|
263 | public function isEmpty() { |
||
267 | |||
268 | /** |
||
269 | * @since 1.1 |
||
270 | 1 | * |
|
271 | 1 | * @return StatementList |
|
272 | 1 | */ |
|
273 | public function getStatements() { |
||
276 | |||
277 | /** |
||
278 | * @since 1.1 |
||
279 | * |
||
280 | * @param StatementList $statements |
||
281 | */ |
||
282 | public function setStatements( StatementList $statements ) { |
||
285 | |||
286 | /** |
||
287 | * @see EntityDocument::copy |
||
288 | * |
||
289 | * @since 0.1 |
||
290 | * |
||
291 | * @return self |
||
292 | */ |
||
293 | public function copy() { |
||
296 | |||
297 | /** |
||
298 | * @see http://php.net/manual/en/language.oop5.cloning.php |
||
299 | * |
||
300 | * @since 5.1 |
||
301 | */ |
||
302 | public function __clone() { |
||
306 | |||
307 | /** |
||
308 | * @since 7.5 |
||
309 | */ |
||
310 | public function clear() { |
||
314 | |||
315 | } |
||
316 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.