Document/Subscriber/ArticleSubscriber.php
public function publishChildren(PublishEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticleDocument) {
            return;
        }

        $children = iterator_to_array($document->getChildren());
        foreach ($children as $child) {
            if (LocalizationState::GHOST !== $this->documentInspector->getLocalizationState($child)) {
                $this->documentManager->publish($child, $event->getLocale());
            }
        }
    }
public function publishChildren(PublishEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticleDocument) {
            return;
        }

        $children = iterator_to_array($document->getChildren());
        foreach ($children as $child) {
            if (LocalizationState::GHOST !== $this->documentInspector->getLocalizationState($child)) {
                $this->documentManager->publish($child, $event->getLocale());
            }
        }
    }
public function publishChildren ( PublishEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( ! $ document instanceof ArticleDocument ) { return ; } $ children = iterator_to_array ( $ document -> getChildren ( ) ) ; foreach ( $ children as $ child ) { if ( LocalizationState :: GHOST !== $ this -> documentInspector -> getLocalizationState ( $ child ) ) { $ this -> documentManager -> publish ( $ child , $ event -> getLocale ( ) ) ; } } }
Publish pages when article will be published.

@param PublishEvent $event
Publish pages when article will be published .