Skip to content

Commit

Permalink
EM: Clear will support specific entity, but rewrite to class name.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Apr 1, 2020
1 parent 577efdc commit ed091c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,15 @@ public function merge($object)


/**
* @param string|null $objectName if given, only objects of this type will get detached.
* @param string|mixed|null $objectName if given, only objects of this type will get detached.
* @return void
* @throws MappingException
*/
public function clear($objectName = null): void
{
if ($objectName !== null && \is_string($objectName) === false) {
$objectName = \get_class($objectName);
}
$this->em()->clear($objectName);
}

Expand Down

0 comments on commit ed091c1

Please sign in to comment.