Doctrine\ODM\MongoDB\UnitOfWork::removeFromIdentityMap PHP Method

removeFromIdentityMap() public method

INTERNAL: Removes a document from the identity map. This effectively detaches the document from the persistence management of Doctrine.
public removeFromIdentityMap ( object $document ) : boolean
$document object
return boolean
    public function removeFromIdentityMap($document)
    {
        $oid = spl_object_hash($document);
        // Check if id is registered first
        if (!isset($this->documentIdentifiers[$oid])) {
            return false;
        }
        $class = $this->dm->getClassMetadata(get_class($document));
        $id = $this->getIdForIdentityMap($document);
        if (isset($this->identityMap[$class->name][$id])) {
            unset($this->identityMap[$class->name][$id]);
            $this->documentStates[$oid] = self::STATE_DETACHED;
            return true;
        }
        return false;
    }
UnitOfWork