interface StaticMenuLinkOverridesInterface

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/StaticMenuLinkOverridesInterface.php \Drupal\Core\Menu\StaticMenuLinkOverridesInterface
  2. 8.9.x core/lib/Drupal/Core/Menu/StaticMenuLinkOverridesInterface.php \Drupal\Core\Menu\StaticMenuLinkOverridesInterface
  3. 10 core/lib/Drupal/Core/Menu/StaticMenuLinkOverridesInterface.php \Drupal\Core\Menu\StaticMenuLinkOverridesInterface

Defines an interface for objects which overrides menu links defined in YAML.

Hierarchy

Expanded class hierarchy of StaticMenuLinkOverridesInterface

All classes that implement StaticMenuLinkOverridesInterface

4 files declare their use of StaticMenuLinkOverridesInterface
LoginLogoutMenuLink.php in core/modules/user/src/Plugin/Menu/LoginLogoutMenuLink.php
MenuLinkDefaultFormTest.php in core/tests/Drupal/Tests/Core/Menu/MenuLinkDefaultFormTest.php
MenuLinkDefaultTest.php in core/tests/Drupal/Tests/Core/Menu/MenuLinkDefaultTest.php
MenuLinkParentTest.php in core/modules/migrate/tests/src/Unit/process/MenuLinkParentTest.php

File

core/lib/Drupal/Core/Menu/StaticMenuLinkOverridesInterface.php, line 8

Namespace

Drupal\Core\Menu
View source
interface StaticMenuLinkOverridesInterface {
    
    /**
     * Reloads the overrides from config.
     *
     * Forces all overrides to be reloaded from config storage to compare the
     * override value with the value submitted during test form submission.
     */
    public function reload();
    
    /**
     * Loads any overrides to the definition of a static (YAML-defined) link.
     *
     * @param string $id
     *   A menu link plugin ID.
     *
     * @return array
     *   An override with following supported keys:
     *     - parent
     *     - weight
     *     - menu_name
     *     - expanded
     *     - enabled
     *   or an empty array if there is no override for the given ID.
     */
    public function loadOverride($id);
    
    /**
     * Deletes any overrides to the definition of a static (YAML-defined) link.
     *
     * @param string $id
     *   A menu link plugin ID.
     */
    public function deleteOverride($id);
    
    /**
     * Deletes multiple overrides to definitions of static (YAML-defined) links.
     *
     * @param array $ids
     *   Array of menu link plugin IDs.
     */
    public function deleteMultipleOverrides(array $ids);
    
    /**
     * Loads overrides to multiple definitions of a static (YAML-defined) link.
     *
     * @param array $ids
     *   Array of menu link plugin IDs.
     *
     * @return array
     *   One or override keys by plugin ID.
     *
     * @see \Drupal\Core\Menu\StaticMenuLinkOverridesInterface
     */
    public function loadMultipleOverrides(array $ids);
    
    /**
     * Saves the override.
     *
     * @param string $id
     *   A menu link plugin ID.
     * @param array $definition
     *   The definition values to override. Supported keys:
     *   - menu_name
     *   - parent
     *   - weight
     *   - expanded
     *   - enabled
     *
     * @return array
     *   A list of properties which got saved.
     */
    public function saveOverride($id, array $definition);
    
    /**
     * The unique cache tag associated with this menu link override.
     *
     * @return string[]
     *   An array of cache tags.
     */
    public function getCacheTags();

}

Members

Title Sort descending Modifiers Object type Summary Overrides
StaticMenuLinkOverridesInterface::deleteMultipleOverrides public function Deletes multiple overrides to definitions of static (YAML-defined) links. 1
StaticMenuLinkOverridesInterface::deleteOverride public function Deletes any overrides to the definition of a static (YAML-defined) link. 1
StaticMenuLinkOverridesInterface::getCacheTags public function The unique cache tag associated with this menu link override. 1
StaticMenuLinkOverridesInterface::loadMultipleOverrides public function Loads overrides to multiple definitions of a static (YAML-defined) link. 1
StaticMenuLinkOverridesInterface::loadOverride public function Loads any overrides to the definition of a static (YAML-defined) link. 1
StaticMenuLinkOverridesInterface::reload public function Reloads the overrides from config. 1
StaticMenuLinkOverridesInterface::saveOverride public function Saves the override. 1

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.