protected function 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\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); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Menu!MenuTreeStorage.php/function/MenuTreeStorage::purgeMultiple/8.1.x