1.20.x layout_menu_item.class.inc LayoutMenuItem::resetContexts()

Reset the internally stored contexts.

This is used before storing a layout, or when fresh contexts are important, such as when actively changing the layout's path.

File

modules/layout/includes/layout_menu_item.class.inc, line 272
Class for storing information about menu item entries.

Class

LayoutMenuItem
@file Class for storing information about menu item entries.

Code

function resetContexts() {
  foreach ($this->contexts as $key => $context) {
    if (!$context->storage) {
      unset($this->contexts[$key]);
    }
  }
}