You are here

public function PluginManagerBase::getInstance in Service Container 7.2

Same name in this branch
  1. 7.2 src/Plugin/PluginManagerBase.php \Drupal\service_container\Plugin\PluginManagerBase::getInstance()
  2. 7.2 lib/Drupal/Component/Plugin/PluginManagerBase.php \Drupal\Component\Plugin\PluginManagerBase::getInstance()
Same name and namespace in other branches
  1. 7 lib/Drupal/Component/Plugin/PluginManagerBase.php \Drupal\Component\Plugin\PluginManagerBase::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 depends on the plugin type. If no instance can be retrieved, FALSE will be returned.

Overrides MapperInterface::getInstance

File

lib/Drupal/Component/Plugin/PluginManagerBase.php, line 96
Contains \Drupal\Component\Plugin\PluginManagerBase.

Class

PluginManagerBase
Base class for plugin managers.

Namespace

Drupal\Component\Plugin

Code

public function getInstance(array $options) {
  return $this->mapper
    ->getInstance($options);
}