private function doRefresh($document, array &$visited)
    {
        $oid = spl_object_hash($document);
        if (isset($visited[$oid])) {
            return; // Prevent infinite recursion
        }

        $visited[$oid] = $document; // mark visited

        $class = $this->dm->getClassMetadata(get_class($document));

        if (!$class->isEmbeddedDocument) {
            if ($this->getDocumentState($document) !== self::STATE_MANAGED) {
                throw new \InvalidArgumentException('Document is not MANAGED.');
            }

            $identifier = $this->documentIdentifiers[$oid];
            $this->getDocumentPersister($class->name)->refresh($identifier, $document);
        }

        $this->cascadeRefresh($document, $visited);
    }
private function doRefresh($document, array &$visited)
    {
        $oid = spl_object_hash($document);
        if (isset($visited[$oid])) {
            return; // Prevent infinite recursion
        }

        $visited[$oid] = $document; // mark visited

        $class = $this->dm->getClassMetadata(get_class($document));

        if (!$class->isEmbeddedDocument) {
            if ($this->getDocumentState($document) !== self::STATE_MANAGED) {
                throw new \InvalidArgumentException('Document is not MANAGED.');
            }

            $identifier = $this->documentIdentifiers[$oid];
            $this->getDocumentPersister($class->name)->refresh($identifier, $document);
        }

        $this->cascadeRefresh($document, $visited);
    }
private function doRefresh ( $ document , array & $ visited ) { $ oid = spl_object_hash ( $ document ) ; if ( isset ( $ visited [ $ oid ] ) ) { return ; // Prevent infinite recursion } $ visited [ $ oid ] = $ document ; // mark visited $ class = $ this -> dm -> getClassMetadata ( get_class ( $ document ) ) ; if ( ! $ class -> isEmbeddedDocument ) { if ( $ this -> getDocumentState ( $ document ) !== self :: STATE_MANAGED ) { throw new \ InvalidArgumentException ( 'Document is not MANAGED.' ) ; } $ identifier = $ this -> documentIdentifiers [ $ oid ] ; $ this -> getDocumentPersister ( $ class -> name ) -> refresh ( $ identifier , $ document ) ; } $ this -> cascadeRefresh ( $ document , $ visited ) ; }
Executes a refresh operation on a document.

@param object $document The document to refresh.
@param array  $visited  The already visited documents during cascades.

@return void

@throws \InvalidArgumentException If the document is not MANAGED.
Executes a refresh operation on a document .