You are here

public function TypePluginManager::getInstance in GraphQL 8.3

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/Plugin/TypePluginManager.php, line 66

Class

TypePluginManager

Namespace

Drupal\graphql\Plugin

Code

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