protected function MenuTreeStorage::purgeMultiple in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Menu/MenuTreeStorage.php \Drupal\Core\Menu\MenuTreeStorage::purgeMultiple()
Purges multiple menu links that no longer exist.
Parameters
array $ids: An array of menu link IDs.
1 call to MenuTreeStorage::purgeMultiple()
- MenuTreeStorage::rebuild in core/
lib/ Drupal/ Core/ Menu/ MenuTreeStorage.php - Rebuilds the stored menu link definitions.
File
- core/
lib/ Drupal/ Core/ Menu/ MenuTreeStorage.php, line 218 - Contains \Drupal\Core\Menu\MenuTreeStorage.
Class
- MenuTreeStorage
- Provides a menu tree storage using the database.
Namespace
Drupal\Core\MenuCode
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);
}