1 | <?php |
||
22 | class Item extends Entity implements StatementListHolder { |
||
|
|||
23 | |||
24 | const ENTITY_TYPE = 'item'; |
||
25 | |||
26 | /** |
||
27 | * @var ItemId|null |
||
28 | */ |
||
29 | private $id; |
||
30 | |||
31 | /** |
||
32 | * @var Fingerprint |
||
33 | */ |
||
34 | private $fingerprint; |
||
35 | |||
36 | /** |
||
37 | * @var SiteLinkList |
||
38 | */ |
||
39 | private $siteLinks; |
||
40 | |||
41 | /** |
||
42 | * @var StatementList |
||
43 | */ |
||
44 | private $statements; |
||
45 | |||
46 | /** |
||
47 | * @since 1.0 |
||
48 | * |
||
49 | * @param ItemId|null $id |
||
50 | * @param Fingerprint|null $fingerprint |
||
51 | * @param SiteLinkList|null $siteLinks |
||
52 | * @param StatementList|null $statements |
||
53 | */ |
||
54 | public function __construct( |
||
65 | |||
66 | /** |
||
67 | * Returns the id of the entity or null if it does not have one. |
||
68 | * |
||
69 | * @since 0.1 return type changed in 0.3 |
||
70 | * |
||
71 | * @return ItemId|null |
||
72 | */ |
||
73 | public function getId() { |
||
76 | |||
77 | /** |
||
78 | * Can be integer since 0.1. |
||
79 | * Can be ItemId since 0.5. |
||
80 | * Can be null since 1.0. |
||
81 | * |
||
82 | * @param ItemId|int|null $id |
||
83 | * |
||
84 | * @throws InvalidArgumentException |
||
85 | */ |
||
86 | public function setId( $id ) { |
||
96 | |||
97 | /** |
||
98 | * @since 0.7.3 |
||
99 | * |
||
100 | * @return Fingerprint |
||
101 | */ |
||
102 | public function getFingerprint() { |
||
105 | |||
106 | /** |
||
107 | * @since 0.7.3 |
||
108 | * |
||
109 | * @param Fingerprint $fingerprint |
||
110 | */ |
||
111 | public function setFingerprint( Fingerprint $fingerprint ) { |
||
114 | |||
115 | /** |
||
116 | * @param string $languageCode |
||
117 | * @param string $value |
||
118 | * |
||
119 | * @throws InvalidArgumentException |
||
120 | */ |
||
121 | public function setLabel( $languageCode, $value ) { |
||
124 | |||
125 | /** |
||
126 | * @param string $languageCode |
||
127 | * @param string $value |
||
128 | * |
||
129 | * @throws InvalidArgumentException |
||
130 | */ |
||
131 | public function setDescription( $languageCode, $value ) { |
||
134 | |||
135 | /** |
||
136 | * @param string $languageCode |
||
137 | * @param string[] $aliases |
||
138 | * |
||
139 | * @throws InvalidArgumentException |
||
140 | */ |
||
141 | public function setAliases( $languageCode, array $aliases ) { |
||
144 | |||
145 | /** |
||
146 | * @since 0.8 |
||
147 | * |
||
148 | * @return SiteLinkList |
||
149 | */ |
||
150 | public function getSiteLinkList() { |
||
153 | |||
154 | /** |
||
155 | * @since 0.8 |
||
156 | * |
||
157 | * @param SiteLinkList $siteLinks |
||
158 | */ |
||
159 | public function setSiteLinkList( SiteLinkList $siteLinks ) { |
||
162 | |||
163 | /** |
||
164 | * Adds a site link to the list of site links. |
||
165 | * If there already is a site link with the site id of the provided site link, |
||
166 | * then that one will be overridden by the provided one. |
||
167 | * |
||
168 | * @deprecated since 0.8, use getSiteLinkList()->addSiteLink() instead. |
||
169 | * @since 0.6 |
||
170 | * |
||
171 | * @param SiteLink $siteLink |
||
172 | */ |
||
173 | public function addSiteLink( SiteLink $siteLink ) { |
||
180 | |||
181 | /** |
||
182 | * Removes the sitelink with specified site ID if the Item has such a sitelink. |
||
183 | * |
||
184 | * @deprecated since 0.8, use getSiteLinkList()->removeLinkWithSiteId() instead. |
||
185 | * @since 0.1 |
||
186 | * |
||
187 | * @param string $siteId the target site's id |
||
188 | */ |
||
189 | public function removeSiteLink( $siteId ) { |
||
192 | |||
193 | /** |
||
194 | * @deprecated since 0.8, use getSiteLinkList() instead, |
||
195 | * @since 0.6 |
||
196 | * |
||
197 | * @return SiteLink[] |
||
198 | */ |
||
199 | public function getSiteLinks() { |
||
202 | |||
203 | /** |
||
204 | * @deprecated since 0.8, use getSiteLinkList()->getBySiteId() instead. |
||
205 | * @since 0.6 |
||
206 | * |
||
207 | * @param string $siteId |
||
208 | * |
||
209 | * @return SiteLink |
||
210 | * @throws OutOfBoundsException |
||
211 | */ |
||
212 | public function getSiteLink( $siteId ) { |
||
215 | |||
216 | /** |
||
217 | * @deprecated since 0.8, use getSiteLinkList()->hasLinkWithSiteId() instead. |
||
218 | * @since 0.4 |
||
219 | * |
||
220 | * @param string $siteId |
||
221 | * |
||
222 | * @return bool |
||
223 | */ |
||
224 | public function hasLinkToSite( $siteId ) { |
||
227 | |||
228 | /** |
||
229 | * @deprecated since 0.8, use getSiteLinkList()->isEmpty() instead. |
||
230 | * @since 0.5 |
||
231 | * |
||
232 | * @return bool |
||
233 | */ |
||
234 | public function hasSiteLinks() { |
||
237 | |||
238 | /** |
||
239 | * @deprecated since 2.5, use new Item() instead. |
||
240 | * |
||
241 | * @return Item |
||
242 | */ |
||
243 | public static function newEmpty() { |
||
246 | |||
247 | /** |
||
248 | * @see Entity::getType |
||
249 | * |
||
250 | * @since 0.1 |
||
251 | * |
||
252 | * @return string Returns the entity type "item". |
||
253 | */ |
||
254 | public function getType() { |
||
257 | |||
258 | /** |
||
259 | * Returns if the Item has no content. |
||
260 | * Having an id set does not count as having content. |
||
261 | * |
||
262 | * @since 0.1 |
||
263 | * |
||
264 | * @return bool |
||
265 | */ |
||
266 | public function isEmpty() { |
||
271 | |||
272 | /** |
||
273 | * @since 1.0 |
||
274 | * |
||
275 | * @return StatementList |
||
276 | */ |
||
277 | public function getStatements() { |
||
280 | |||
281 | /** |
||
282 | * @since 1.0 |
||
283 | * |
||
284 | * @param StatementList $statements |
||
285 | */ |
||
286 | public function setStatements( StatementList $statements ) { |
||
289 | |||
290 | /** |
||
291 | * @see Comparable::equals |
||
292 | * |
||
293 | * Two items are considered equal if they are of the same |
||
294 | * type and have the same value. The value does not include |
||
295 | * the id, so entities with the same value but different id |
||
296 | * are considered equal. |
||
297 | * |
||
298 | * @since 0.1 |
||
299 | * |
||
300 | * @param mixed $target |
||
301 | * |
||
302 | * @return bool |
||
303 | */ |
||
304 | public function equals( $target ) { |
||
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.