Skip to content

Commit

Permalink
Add reopen method
Browse files Browse the repository at this point in the history
  • Loading branch information
alekseytkachenko authored and mrVrAlex committed Jun 23, 2022
1 parent 9ff3688 commit 44b9639
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit 44b9639

Please sign in to comment.