Doctrine\OXM\UnitOfWork::removeFromIdentityMap PHP Method

removeFromIdentityMap() public method

INTERNAL: Removes an entity from the identity map. This effectively detaches the entity from the persistence management of Doctrine.
public removeFromIdentityMap ( object $entity ) : boolean
$entity object
return boolean
    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;
    }