public function CheeseburgerMenuBlock::onDependencyRemoval in Cheeseburger Menu 5.0.x
Currently unused.
Issue that will never be fixed obviously.
Parameters
array $dependencies: Dependencies that will be removed.
Return value
bool Does
See also
https://www.drupal.org/project/drupal/issues/3193344
File
- src/
Plugin/ Block/ CheeseburgerMenuBlock.php, line 145
Class
- CheeseburgerMenuBlock
- Provides a 'CheeseburgerMenu' block.
Namespace
Drupal\cheeseburger_menu\Plugin\BlockCode
public function onDependencyRemoval(array $dependencies) {
$menus = $this
->getConfigValue('menus');
foreach ($dependencies['config'] as $dependency) {
foreach ($menus as $menu_id => $menu) {
if ($dependency
->getEntityTypeId() === $menu['menu_type'] && $dependency
->id() === $menu['id']) {
unset($menus[$menu_id]);
}
}
}
$this
->setConfigurationValue('menus', $menus);
return TRUE;
}