src/Sulu/Component/DocumentManager/Subscriber/Behavior/VersionSubscriber.php
public function restoreProperties(RestoreEvent $event)
    {
        if (!$this->support($event->getDocument())) {
            $event->stopPropagation();

            return;
        }

        $contentPropertyPrefix = $this->propertyEncoder->localizedContentName('', $event->getLocale());
        $systemPropertyPrefix = $this->propertyEncoder->localizedSystemName('', $event->getLocale());

        $node = $event->getNode();

        try {
            $version = $this->versionManager->getVersionHistory($node->getPath())->getVersion($event->getVersion());

            $frozenNode = $version->getFrozenNode();

            $this->restoreNode($node, $frozenNode, $contentPropertyPrefix, $systemPropertyPrefix);
        } catch (VersionException $exception) {
            throw new VersionNotFoundException($event->getDocument(), $event->getVersion());
        }
    }
public function restoreProperties(RestoreEvent $event)
    {
        if (!$this->support($event->getDocument())) {
            $event->stopPropagation();

            return;
        }

        $contentPropertyPrefix = $this->propertyEncoder->localizedContentName('', $event->getLocale());
        $systemPropertyPrefix = $this->propertyEncoder->localizedSystemName('', $event->getLocale());

        $node = $event->getNode();

        try {
            $version = $this->versionManager->getVersionHistory($node->getPath())->getVersion($event->getVersion());

            $frozenNode = $version->getFrozenNode();

            $this->restoreNode($node, $frozenNode, $contentPropertyPrefix, $systemPropertyPrefix);
        } catch (VersionException $exception) {
            throw new VersionNotFoundException($event->getDocument(), $event->getVersion());
        }
    }
public function restoreProperties ( RestoreEvent $ event ) { if ( ! $ this -> support ( $ event -> getDocument ( ) ) ) { $ event -> stopPropagation ( ) ; return ; } $ contentPropertyPrefix = $ this -> propertyEncoder -> localizedContentName ( '' , $ event -> getLocale ( ) ) ; $ systemPropertyPrefix = $ this -> propertyEncoder -> localizedSystemName ( '' , $ event -> getLocale ( ) ) ; $ node = $ event -> getNode ( ) ; try { $ version = $ this -> versionManager -> getVersionHistory ( $ node -> getPath ( ) ) -> getVersion ( $ event -> getVersion ( ) ) ; $ frozenNode = $ version -> getFrozenNode ( ) ; $ this -> restoreNode ( $ node , $ frozenNode , $ contentPropertyPrefix , $ systemPropertyPrefix ) ; } catch ( VersionException $ exception ) { throw new VersionNotFoundException ( $ event -> getDocument ( ) , $ event -> getVersion ( ) ) ; } }
Restore the properties of the old version.

@param RestoreEvent $event

@throws VersionNotFoundException
Restore the properties of the old version .