diff --git a/src/EntityManager.php b/src/EntityManager.php index 4c17d39..b655750 100644 --- a/src/EntityManager.php +++ b/src/EntityManager.php @@ -406,4 +406,14 @@ public function contains($object) { return $this->getWrappedEm()->contains($object); } + + public function reopen() : void + { + $em = $this->getWrappedEm(); + if ($em->isOpen()) { + $em->clear(); + } else { + $this->emStorage->offsetUnset($em); + } + } }