src/Sulu/Component/Content/Document/Subscriber/StructureSubscriber.php
public function handlePersistStructureType(PersistEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supportsBehavior($document)) {
            return;
        }

        $structureMetadata = $this->inspector->getStructureMetadata($document);

        $structure = $document->getStructure();
        if ($structure instanceof ManagedStructure) {
            $structure->setStructureMetadata($structureMetadata);
        }
    }
public function handlePersistStructureType(PersistEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supportsBehavior($document)) {
            return;
        }

        $structureMetadata = $this->inspector->getStructureMetadata($document);

        $structure = $document->getStructure();
        if ($structure instanceof ManagedStructure) {
            $structure->setStructureMetadata($structureMetadata);
        }
    }
public function handlePersistStructureType ( PersistEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( ! $ this -> supportsBehavior ( $ document ) ) { return ; } $ structureMetadata = $ this -> inspector -> getStructureMetadata ( $ document ) ; $ structure = $ document -> getStructure ( ) ; if ( $ structure instanceof ManagedStructure ) { $ structure -> setStructureMetadata ( $ structureMetadata ) ; } }
Set the structure type early so that subsequent subscribers operate
upon the correct structure type.

@param PersistEvent $event
Set the structure type early so that subsequent subscribers operate upon the correct structure type .