You are here

protected function EntityMenuLinkContentUrlGenerator::getMenuChildrenRecursively in Simple XML sitemap 8.2

Recursively get the child menu links.

Parameters

\Drupal\Core\Menu\MenuLinkTreeElement $parent: The parent of the menu subtree.

1 call to EntityMenuLinkContentUrlGenerator::getMenuChildrenRecursively()
EntityMenuLinkContentUrlGenerator::getBatchIterationElements in src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php
@inheritdoc

File

src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php, line 228

Class

EntityMenuLinkContentUrlGenerator
Class EntityMenuLinkContentUrlGenerator @package Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator

Namespace

Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator

Code

protected function getMenuChildrenRecursively($parent) {
  foreach ($parent->subtree as $i => $item) {
    $this->elements[] = $item->link;
    if ($item->hasChildren) {
      $this
        ->getMenuChildrenRecursively($item);
    }
  }
}