src/Sulu/Component/DocumentManager/Subscriber/Core/RegistratorSubscriber.php
public function handleDocumentFromRegistry(HydrateEvent $event)
    {
        if ($event->hasDocument()) {
            return;
        }

        $node = $event->getNode();
        if (!$this->documentRegistry->hasNode($node, $event->getLocale())) {
            return;
        }

        $document = $this->documentRegistry->getDocumentForNode($node, $event->getLocale());

        $event->setDocument($document);

        $options = $event->getOptions();

        // if reydration is not required (f.e. we just want to retrieve the
        // current state of the document, no matter it's current state) stop
        // further event propagation - we have the document now.
        if (isset($options['rehydrate']) && false === $options['rehydrate']) {
            $event->stopPropagation();
        }
    }
public function handleDocumentFromRegistry(HydrateEvent $event)
    {
        if ($event->hasDocument()) {
            return;
        }

        $node = $event->getNode();
        if (!$this->documentRegistry->hasNode($node, $event->getLocale())) {
            return;
        }

        $document = $this->documentRegistry->getDocumentForNode($node, $event->getLocale());

        $event->setDocument($document);

        $options = $event->getOptions();

        // if reydration is not required (f.e. we just want to retrieve the
        // current state of the document, no matter it's current state) stop
        // further event propagation - we have the document now.
        if (isset($options['rehydrate']) && false === $options['rehydrate']) {
            $event->stopPropagation();
        }
    }
public function handleDocumentFromRegistry ( HydrateEvent $ event ) { if ( $ event -> hasDocument ( ) ) { return ; } $ node = $ event -> getNode ( ) ; if ( ! $ this -> documentRegistry -> hasNode ( $ node , $ event -> getLocale ( ) ) ) { return ; } $ document = $ this -> documentRegistry -> getDocumentForNode ( $ node , $ event -> getLocale ( ) ) ; $ event -> setDocument ( $ document ) ; $ options = $ event -> getOptions ( ) ; // if reydration is not required (f.e. we just want to retrieve the // current state of the document, no matter it's current state) stop // further event propagation - we have the document now. if ( isset ( $ options [ 'rehydrate' ] ) && false === $ options [ 'rehydrate' ] ) { $ event -> stopPropagation ( ) ; } }
If there is already a document for the node registered, use that.

@param HydrateEvent $event
If there is already a document for the node registered use that .