You are here

public static function WeMegaMenuBuilder::getMegamenuSubIds in Drupal Mega Menu 8.x

Same name and namespace in other branches
  1. 8 src/WeMegaMenuBuilder.php \Drupal\we_megamenu\WeMegaMenuBuilder::getMegamenuSubIds()
1 call to WeMegaMenuBuilder::getMegamenuSubIds()
WeMegaMenuBuilder::compareItem in src/WeMegaMenuBuilder.php

File

src/WeMegaMenuBuilder.php, line 771

Class

WeMegaMenuBuilder

Namespace

Drupal\we_megamenu

Code

public static function getMegamenuSubIds($item) {
  $ids = [];
  foreach ($item['rows_content'] as $i => $cols) {
    foreach ($cols as $j => $col) {
      $col_content = isset($col['col_content']) ? $col['col_content'] : [];
      foreach ($col_content as $k => $sub_item) {
        if ($sub_item['type'] == 'we-mega-menu-li') {
          $ids[] = $sub_item['mlid'];
        }
      }
    }
  }
  return $ids;
}