private function disablePageChildren(PageInterface $page)
    {
        $childrenDisabled = false;
        if (!$page->isEnabled()) {
            if (0 < $page->getChildren()->count()) {
                foreach ($page->getChildren() as $child) {
                    if ($child->isEnabled()) {
                        $child->setEnabled(false);
                        $childrenDisabled = true;

                        $this->em->persist($child);

                        $this->deletePageCache($page);

                        $this->tm->addTags($page->getEntityTag());
                    }

                    $this->disablePageRelativeMenus($child);

                    $childrenDisabled |= $this->disablePageChildren($child);
                }
            }
        }
        return $childrenDisabled;
    }
private function disablePageChildren(PageInterface $page)
    {
        $childrenDisabled = false;
        if (!$page->isEnabled()) {
            if (0 < $page->getChildren()->count()) {
                foreach ($page->getChildren() as $child) {
                    if ($child->isEnabled()) {
                        $child->setEnabled(false);
                        $childrenDisabled = true;

                        $this->em->persist($child);

                        $this->deletePageCache($page);

                        $this->tm->addTags($page->getEntityTag());
                    }

                    $this->disablePageRelativeMenus($child);

                    $childrenDisabled |= $this->disablePageChildren($child);
                }
            }
        }
        return $childrenDisabled;
    }
private function disablePageChildren ( PageInterface $ page ) { $ childrenDisabled = false ; if ( ! $ page -> isEnabled ( ) ) { if ( 0 < $ page -> getChildren ( ) -> count ( ) ) { foreach ( $ page -> getChildren ( ) as $ child ) { if ( $ child -> isEnabled ( ) ) { $ child -> setEnabled ( false ) ; $ childrenDisabled = true ; $ this -> em -> persist ( $ child ) ; $ this -> deletePageCache ( $ page ) ; $ this -> tm -> addTags ( $ page -> getEntityTag ( ) ) ; } $ this -> disablePageRelativeMenus ( $ child ) ; $ childrenDisabled |= $ this -> disablePageChildren ( $ child ) ; } } } return $ childrenDisabled ; }
Disables the page children if needed.

@param PageInterface $page

@return bool
Disables the page children if needed .