Document/Subscriber/ArticlePageSubscriber.php
public function setStructureTypeToParent(PersistEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticlePageDocument
            || LocalizationState::GHOST === $this->documentInspector->getLocalizationState($document->getParent())
            || $document->getStructureType() === $document->getParent()->getStructureType()
        ) {
            return;
        }

        $document->getParent()->setStructureType($document->getStructureType());
        $this->documentManager->persist($document->getParent(), $event->getLocale());
    }
public function setStructureTypeToParent(PersistEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticlePageDocument
            || LocalizationState::GHOST === $this->documentInspector->getLocalizationState($document->getParent())
            || $document->getStructureType() === $document->getParent()->getStructureType()
        ) {
            return;
        }

        $document->getParent()->setStructureType($document->getStructureType());
        $this->documentManager->persist($document->getParent(), $event->getLocale());
    }
public function setStructureTypeToParent ( PersistEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( ! $ document instanceof ArticlePageDocument || LocalizationState :: GHOST === $ this -> documentInspector -> getLocalizationState ( $ document -> getParent ( ) ) || $ document -> getStructureType ( ) === $ document -> getParent ( ) -> getStructureType ( ) ) { return ; } $ document -> getParent ( ) -> setStructureType ( $ document -> getStructureType ( ) ) ; $ this -> documentManager -> persist ( $ document -> getParent ( ) , $ event -> getLocale ( ) ) ; }
Set structure-type to parent document.

@param PersistEvent $event
Set structure - type to parent document .