1 | <?php |
||
29 | class Item implements |
||
30 | StatementListProvidingEntity, |
||
31 | FingerprintProvider, |
||
32 | StatementListHolder, |
||
|
|||
33 | LabelsProvider, |
||
34 | DescriptionsProvider, |
||
35 | AliasesProvider, |
||
36 | ClearableEntity |
||
37 | { |
||
38 | |||
39 | public const ENTITY_TYPE = 'item'; |
||
40 | |||
41 | /** |
||
42 | * @var ItemId|null |
||
43 | */ |
||
44 | private $id; |
||
45 | |||
46 | /** |
||
47 | * @var Fingerprint |
||
48 | */ |
||
49 | private $fingerprint; |
||
50 | |||
51 | /** |
||
52 | * @var SiteLinkList |
||
53 | */ |
||
54 | private $siteLinks; |
||
55 | |||
56 | 81 | /** |
|
57 | * @var StatementList |
||
58 | */ |
||
59 | private $statements; |
||
60 | |||
61 | /** |
||
62 | 81 | * @since 1.0 |
|
63 | 81 | * |
|
64 | 81 | * @param ItemId|null $id |
|
65 | 81 | * @param Fingerprint|null $fingerprint |
|
66 | 81 | * @param SiteLinkList|null $siteLinks |
|
67 | * @param StatementList|null $statements |
||
68 | */ |
||
69 | public function __construct( |
||
80 | |||
81 | /** |
||
82 | * Returns the id of the entity or null if it does not have one. |
||
83 | * |
||
84 | * @since 0.1 return type changed in 0.3 |
||
85 | * |
||
86 | * @return ItemId|null |
||
87 | */ |
||
88 | 2 | public function getId() { |
|
91 | 2 | ||
92 | 1 | /** |
|
93 | 1 | * @since 0.5, can be null since 1.0 |
|
94 | * |
||
95 | * @param ItemId|null $id |
||
96 | * |
||
97 | 2 | * @throws InvalidArgumentException |
|
98 | */ |
||
99 | public function setId( $id ) { |
||
106 | |||
107 | /** |
||
108 | * @since 0.7.3 |
||
109 | * |
||
110 | * @return Fingerprint |
||
111 | */ |
||
112 | public function getFingerprint() { |
||
115 | 3 | ||
116 | /** |
||
117 | * @since 0.7.3 |
||
118 | * |
||
119 | * @param Fingerprint $fingerprint |
||
120 | */ |
||
121 | public function setFingerprint( Fingerprint $fingerprint ) { |
||
124 | 12 | ||
125 | 12 | /** |
|
126 | * @see LabelsProvider::getLabels |
||
127 | * |
||
128 | * @since 6.0 |
||
129 | * |
||
130 | * @return TermList |
||
131 | */ |
||
132 | public function getLabels() { |
||
135 | 11 | ||
136 | /** |
||
137 | * @see DescriptionsProvider::getDescriptions |
||
138 | * |
||
139 | * @since 6.0 |
||
140 | * |
||
141 | * @return TermList |
||
142 | */ |
||
143 | 31 | public function getDescriptions() { |
|
146 | |||
147 | /** |
||
148 | * @see AliasesProvider::getAliasGroups |
||
149 | * |
||
150 | * @since 6.0 |
||
151 | * |
||
152 | 17 | * @return AliasGroupList |
|
153 | 17 | */ |
|
154 | public function getAliasGroups() { |
||
157 | |||
158 | /** |
||
159 | * @param string $languageCode |
||
160 | * @param string $value |
||
161 | * |
||
162 | * @throws InvalidArgumentException |
||
163 | */ |
||
164 | public function setLabel( $languageCode, $value ) { |
||
167 | |||
168 | /** |
||
169 | * @param string $languageCode |
||
170 | * @param string $value |
||
171 | * |
||
172 | * @throws InvalidArgumentException |
||
173 | */ |
||
174 | public function setDescription( $languageCode, $value ) { |
||
177 | 1 | ||
178 | 1 | /** |
|
179 | * @param string $languageCode |
||
180 | 1 | * @param string[] $aliases |
|
181 | 1 | * |
|
182 | * @throws InvalidArgumentException |
||
183 | */ |
||
184 | public function setAliases( $languageCode, array $aliases ) { |
||
187 | |||
188 | /** |
||
189 | * @since 0.8 |
||
190 | * |
||
191 | * @return SiteLinkList |
||
192 | */ |
||
193 | public function getSiteLinkList() { |
||
196 | |||
197 | /** |
||
198 | * @since 0.8 |
||
199 | * |
||
200 | * @param SiteLinkList $siteLinks |
||
201 | 4 | */ |
|
202 | 4 | public function setSiteLinkList( SiteLinkList $siteLinks ) { |
|
205 | |||
206 | /** |
||
207 | * Adds a site link to the list of site links. |
||
208 | * If there already is a site link with the site id of the provided site link, |
||
209 | * then that one will be overridden by the provided one. |
||
210 | * |
||
211 | * @since 0.6 |
||
212 | * |
||
213 | * @param SiteLink $siteLink |
||
214 | */ |
||
215 | public function addSiteLink( SiteLink $siteLink ) { |
||
222 | |||
223 | /** |
||
224 | * Removes the sitelink with specified site ID if the Item has such a sitelink. |
||
225 | * |
||
226 | * @since 0.1 |
||
227 | * |
||
228 | * @param string $siteId the target site's id |
||
229 | */ |
||
230 | public function removeSiteLink( $siteId ) { |
||
233 | |||
234 | /** |
||
235 | * @since 0.6 |
||
236 | * |
||
237 | * @param string $siteId |
||
238 | * |
||
239 | * @return SiteLink |
||
240 | * @throws OutOfBoundsException |
||
241 | */ |
||
242 | public function getSiteLink( $siteId ) { |
||
245 | |||
246 | /** |
||
247 | * @since 0.4 |
||
248 | * |
||
249 | * @param string $siteId |
||
250 | * |
||
251 | * @return bool |
||
252 | */ |
||
253 | public function hasLinkToSite( $siteId ) { |
||
256 | |||
257 | /** |
||
258 | * @deprecated since 2.5, use new Item() instead. |
||
259 | * |
||
260 | * @return self |
||
261 | */ |
||
262 | public static function newEmpty() { |
||
265 | |||
266 | /** |
||
267 | * @see Entity::getType |
||
268 | 3 | * |
|
269 | 3 | * @since 0.1 |
|
270 | 3 | * |
|
271 | 3 | * @return string Returns the entity type "item". |
|
272 | */ |
||
273 | public function getType() { |
||
276 | |||
277 | /** |
||
278 | * Returns if the Item has no content. |
||
279 | * Having an id set does not count as having content. |
||
280 | 2 | * |
|
281 | 2 | * @since 0.1 |
|
282 | 2 | * |
|
283 | 2 | * @return bool |
|
284 | 2 | */ |
|
285 | public function isEmpty() { |
||
290 | |||
291 | 7 | /** |
|
292 | 7 | * @since 1.0 |
|
293 | * |
||
294 | * @return StatementList |
||
295 | */ |
||
296 | public function getStatements() { |
||
299 | |||
300 | 1 | /** |
|
301 | 1 | * @since 1.0 |
|
302 | 1 | * |
|
303 | * @param StatementList $statements |
||
304 | */ |
||
305 | public function setStatements( StatementList $statements ) { |
||
308 | |||
309 | 4 | /** |
|
310 | 4 | * @see EntityDocument::equals |
|
311 | * |
||
312 | * @since 0.1 |
||
313 | * |
||
314 | * @param mixed $target |
||
315 | * |
||
316 | * @return bool |
||
317 | */ |
||
318 | 1 | public function equals( $target ) { |
|
328 | |||
329 | /** |
||
330 | * @see EntityDocument::copy |
||
331 | * |
||
332 | * @since 0.1 |
||
333 | * |
||
334 | * @return self |
||
335 | */ |
||
336 | 18 | public function copy() { |
|
339 | |||
340 | /** |
||
341 | * @see http://php.net/manual/en/language.oop5.cloning.php |
||
342 | 18 | * |
|
343 | 18 | * @since 5.1 |
|
344 | 18 | */ |
|
345 | public function __clone() { |
||
351 | |||
352 | /** |
||
353 | * @since 7.5 |
||
354 | */ |
||
355 | public function clear() { |
||
360 | |||
361 | } |
||
362 |
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.