You are here

public function BUEditorPluginManager::getInstance in BUEditor 8

Same name and namespace in other branches
  1. 8.2 src/BUEditorPluginManager.php \Drupal\bueditor\BUEditorPluginManager::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 PluginManagerBase::getInstance

File

src/BUEditorPluginManager.php, line 66

Class

BUEditorPluginManager
Provides a plugin manager for BUEditor Plugins.

Namespace

Drupal\bueditor

Code

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