MenuTreeStorage::purgeMultiple

protected MenuTreeStorage::purgeMultiple(array $ids)

Purges multiple menu links that no longer exist.

Parameters

array $ids: An array of menu link IDs.

File

core/lib/Drupal/Core/Menu/MenuTreeStorage.php, line 213

Class

MenuTreeStorage
Provides a menu tree storage using the database.

Namespace

Drupal\Core\Menu

Code

protected function purgeMultiple(array $ids) {
  $loaded = $this->loadFullMultiple($ids);
  foreach ($loaded as $id => $link) {
    if ($link['has_children']) {
      $children = $this->loadByProperties(array('parent' => $id));
      foreach ($children as $child) {
        $child['parent'] = $link['parent'];
        $this->save($child);
      }
    }
  }
  $this->doDeleteMultiple($ids);
}
doc_Drupal
2016-10-29 09:27:41
Comments
Leave a Comment

Please login to continue.