You are here

public function MenuLinkManager::getInstance in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::getInstance()
  2. 9 core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::getInstance()

Gets a preconfigured instance of a plugin.

Parameters

array $options: An array of options that can be used to determine a suitable plugin to instantiate and how to configure it.

Return value

object|false A fully configured plugin instance. The interface of the plugin instance will depend on the plugin type. If no instance can be retrieved, FALSE will be returned.

Overrides MapperInterface::getInstance

File

core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 239

Class

MenuLinkManager
Manages discovery, instantiation, and tree building of menu link plugins.

Namespace

Drupal\Core\Menu

Code

public function getInstance(array $options) {
  if (isset($options['id'])) {
    return $this
      ->createInstance($options['id']);
  }
}