File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -233,4 +233,11 @@ public function remove(\Spameri\Elastic\Entity\AbstractElasticEntity $entity): b
233233 return true ;
234234 }
235235
236+
237+ public function clear (): void
238+ {
239+ $ this ->identityMap ->clear ();
240+ $ this ->changeSet ->clear ();
241+ }
242+
236243}
Original file line number Diff line number Diff line change @@ -26,4 +26,10 @@ public function isExisting(
2626 return isset ($ this ->created [$ entity ::class][\spl_object_hash ($ entity )]);
2727 }
2828
29+
30+ public function clear (): void
31+ {
32+ $ this ->created = [];
33+ }
34+
2935}
Original file line number Diff line number Diff line change @@ -121,4 +121,13 @@ private function getSerializedString(\Spameri\Elastic\Entity\AbstractElasticEnti
121121 return \md5 (\serialize ($ serializedArray ));
122122 }
123123
124+
125+ public function clear (): void
126+ {
127+ $ this ->identityMap = [];
128+ $ this ->persisted = [];
129+ $ this ->creatingEntityList = [];
130+ $ this ->uninitializedEntityList = [];
131+ }
132+
124133}
You can’t perform that action at this time.
0 commit comments