Skip to content

Commit 0860299

Browse files
committed
Copy copy methods to Item and Property
1 parent 54bddf2 commit 0860299

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

src/Entity/Item.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,4 +319,15 @@ public function equals( $target ) {
319319
&& $this->statements->equals( $target->statements );
320320
}
321321

322+
/**
323+
* @see EntityDocument::copy
324+
*
325+
* @since 0.1
326+
*
327+
* @return self
328+
*/
329+
public function copy() {
330+
return unserialize( serialize( $this ) );
331+
}
332+
322333
}

src/Entity/Property.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,4 +251,15 @@ public function setStatements( StatementList $statements ) {
251251
$this->statements = $statements;
252252
}
253253

254+
/**
255+
* @see EntityDocument::copy
256+
*
257+
* @since 0.1
258+
*
259+
* @return self
260+
*/
261+
public function copy() {
262+
return unserialize( serialize( $this ) );
263+
}
264+
254265
}

0 commit comments

Comments
 (0)