Skip to content

Commit 96d0157

Browse files
committed
Merge pull request #625 from wmde/clonable
Add EntityDocument::copy
2 parents 09da033 + a97d077 commit 96d0157

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/Entity/EntityDocument.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,15 @@ public function isEmpty();
6868
*/
6969
public function equals( $target );
7070

71+
/**
72+
* Returns a deep clone of the entity. The clone must be equal in all details, including the id.
73+
* Since EntityDocuments are not immutable (at least the id can be set) the method is not
74+
* allowed to return $this.
75+
*
76+
* @since 5.0
77+
*
78+
* @return self
79+
*/
80+
public function copy();
81+
7182
}

0 commit comments

Comments
 (0)