StaticMenuLinkOverrides::loadMultipleOverrides

public StaticMenuLinkOverrides::loadMultipleOverrides(array $ids)

Loads overrides to multiple definitions of a static (YAML-defined) link.

Parameters

array $ids: Array of menu link plugin IDs.

Return value

array One or override keys by plugin ID.

Overrides StaticMenuLinkOverridesInterface::loadMultipleOverrides

See also

\Drupal\Core\Menu\StaticMenuLinkOverridesInterface

File

core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php, line 108

Class

StaticMenuLinkOverrides
Defines an implementation of the menu link override using a config file.

Namespace

Drupal\Core\Menu

Code

public function loadMultipleOverrides(array $ids) {
  $result = array();
  if ($ids) {
    $all_overrides = $this->getConfig()->get('definitions') ? : array();
    foreach ($ids as $id) {
      $encoded_id = static::encodeId($id);
      if (isset($all_overrides[$encoded_id])) {
        $result[$id] = $all_overrides[$encoded_id];
      }
    }
  }
  return $result;
}
doc_Drupal
2016-10-29 09:44:22
Comments
Leave a Comment

Please login to continue.