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

        $locale = $event->getLocale();
        $document = $event->getDocument();
        $options = $event->getOptions();
        $originalLocale = $this->documentRegistry->getOriginalLocaleForDocument($document);

        if (
            (!isset($options['rehydrate']) || false === $options['rehydrate']) &&
            (true === $this->documentRegistry->isHydrated($document) && $originalLocale === $locale)
        ) {
            $event->stopPropagation();
        }
    }
public function handleStopPropagationAndResetLocale(HydrateEvent $event)
    {
        if (!$event->hasDocument()) {
            return;
        }

        $locale = $event->getLocale();
        $document = $event->getDocument();
        $options = $event->getOptions();
        $originalLocale = $this->documentRegistry->getOriginalLocaleForDocument($document);

        if (
            (!isset($options['rehydrate']) || false === $options['rehydrate']) &&
            (true === $this->documentRegistry->isHydrated($document) && $originalLocale === $locale)
        ) {
            $event->stopPropagation();
        }
    }
public function handleStopPropagationAndResetLocale ( HydrateEvent $ event ) { if ( ! $ event -> hasDocument ( ) ) { return ; } $ locale = $ event -> getLocale ( ) ; $ document = $ event -> getDocument ( ) ; $ options = $ event -> getOptions ( ) ; $ originalLocale = $ this -> documentRegistry -> getOriginalLocaleForDocument ( $ document ) ; if ( ( ! isset ( $ options [ 'rehydrate' ] ) || false === $ options [ 'rehydrate' ] ) && ( true === $ this -> documentRegistry -> isHydrated ( $ document ) && $ originalLocale === $ locale ) ) { $ event -> stopPropagation ( ) ; } }
Stop propagation if the document is already loaded in the requested locale.

@param HydrateEvent $event
Stop propagation if the document is already loaded in the requested locale .