protected MenuTreeStorage::purgeMultiple(array $ids)
Purges multiple menu links that no longer exist.
array $ids: An array of menu link IDs.
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