public function removeFromIdentityMap($entity)
{
$oid = spl_object_hash($entity);
$classMetadata = $this->xem->getClassMetadata(get_class($entity));
$id = $this->entityIdentifiers[$oid];
if ($id === '') {
throw new InvalidArgumentException("The given entity has no identity.");
}
$className = $classMetadata->rootXmlEntityName;
if (isset($this->identityMap[$className][$id])) {
unset($this->identityMap[$className][$id]);
//$this->entityStates[$oid] = self::STATE_DETACHED;
return true;
}
return false;
}