public function StaticMenuLinkOverrides::deleteMultipleOverrides in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php \Drupal\Core\Menu\StaticMenuLinkOverrides::deleteMultipleOverrides()
Deletes multiple overrides to definitions of static (YAML-defined) links.
Parameters
array $ids: Array of menu link plugin IDs.
Overrides StaticMenuLinkOverridesInterface::deleteMultipleOverrides
1 call to StaticMenuLinkOverrides::deleteMultipleOverrides()
- StaticMenuLinkOverrides::deleteOverride in core/
lib/ Drupal/ Core/ Menu/ StaticMenuLinkOverrides.php - Deletes any overrides to the definition of a static (YAML-defined) link.
File
- core/
lib/ Drupal/ Core/ Menu/ StaticMenuLinkOverrides.php, line 87 - Contains \Drupal\Core\Menu\StaticMenuLinkOverrides.
Class
- StaticMenuLinkOverrides
- Defines an implementation of the menu link override using a config file.
Namespace
Drupal\Core\MenuCode
public function deleteMultipleOverrides(array $ids) {
$all_overrides = $this
->getConfig()
->get('definitions');
$save = FALSE;
foreach ($ids as $id) {
$id = static::encodeId($id);
if (isset($all_overrides[$id])) {
unset($all_overrides[$id]);
$save = TRUE;
}
}
if ($save) {
$this
->getConfig()
->set('definitions', $all_overrides)
->save();
}
return $save;
}