You are here

public function ResourcePluginManager::getInstance in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/rest/src/Plugin/Type/ResourcePluginManager.php \Drupal\rest\Plugin\Type\ResourcePluginManager::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 PluginManagerBase::getInstance

File

core/modules/rest/src/Plugin/Type/ResourcePluginManager.php, line 45
Contains \Drupal\rest\Plugin\Type\ResourcePluginManager.

Class

ResourcePluginManager
Manages discovery and instantiation of resource plugins.

Namespace

Drupal\rest\Plugin\Type

Code

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