W3cubDocs

/Drupal 8

public function TypedDataManager::getInstance

public TypedDataManager::getInstance(array $options)

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/lib/Drupal/Core/TypedData/TypedDataManager.php, line 138

Class

TypedDataManager
Manages data type plugins.

Namespace

Drupal\Core\TypedData

Code

public function getInstance(array $options) {
  return $this->getPropertyInstance($options['object'], $options['property'], $options['value']);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!TypedData!TypedDataManager.php/function/TypedDataManager::getInstance/8.1.x