File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Wikibase DataModel release notes
22
3+ ## Version 5.0 (dev)
4+
5+ #### Breaking changes
6+
7+ * Removed ` Entity::copy `
8+
39## Version 4.0 (2015-07-28)
410
511#### Breaking changes
Original file line number Diff line number Diff line change @@ -324,18 +324,6 @@ public function setAllAliases( array $aliasLists ) {
324324 }
325325 }
326326
327- /**
328- * Returns a deep copy of the entity.
329- *
330- * @since 0.1
331- * @deprecated since 1.0
332- *
333- * @return self
334- */
335- public function copy () {
336- return unserialize ( serialize ( $ this ) );
337- }
338-
339327 /**
340328 * @since 0.3
341329 * @deprecated since 1.0, use getStatements()->toArray() instead.
Original file line number Diff line number Diff line change @@ -360,32 +360,6 @@ public function instanceProvider() {
360360 return $ argLists ;
361361 }
362362
363- /**
364- * @dataProvider instanceProvider
365- * @param Entity $entity
366- */
367- public function testCopy ( Entity $ entity ) {
368- $ copy = $ entity ->copy ();
369-
370- // The equality method alone is not enough since it does not check the IDs.
371- $ this ->assertTrue ( $ entity ->equals ( $ copy ) );
372- $ this ->assertEquals ( $ entity ->getId (), $ copy ->getId () );
373-
374- $ this ->assertFalse ( $ entity === $ copy );
375- }
376-
377- public function testCopyRetainsLabels () {
378- $ item = new Item ();
379-
380- $ item ->getFingerprint ()->setLabel ( 'en ' , 'foo ' );
381- $ item ->getFingerprint ()->setLabel ( 'de ' , 'bar ' );
382-
383- $ newItem = unserialize ( serialize ( $ item ) );
384-
385- $ this ->assertTrue ( $ newItem ->getFingerprint ()->getLabels ()->hasTermForLanguage ( 'en ' ) );
386- $ this ->assertTrue ( $ newItem ->getFingerprint ()->getLabels ()->hasTermForLanguage ( 'de ' ) );
387- }
388-
389363 /**
390364 * @dataProvider instanceProvider
391365 * @param Entity $entity
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ public function itemProvider() {
8080 $ items [] = $ item ;
8181
8282 /** @var Item $item */
83- $ item = $ item-> copy ( );
83+ $ item = unserialize ( serialize ( $ item ) );
8484 $ item ->getStatements ()->addNewStatement (
8585 new PropertyNoValueSnak ( new PropertyId ( 'P42 ' ) )
8686 );
You can’t perform that action at this time.
0 commit comments