public ConditionManager::createInstance($plugin_id, array $configuration = array())
Creates a pre-configured instance of a plugin.
string $plugin_id: The ID of the plugin being instantiated.
array $configuration: An array of configuration relevant to the plugin instance.
object A fully configured plugin instance.
\Drupal\Component\Plugin\Exception\PluginException If the instance cannot be created, such as if the ID is invalid.
Overrides PluginManagerBase::createInstance
public function createInstance($plugin_id, array $configuration = array()) { $plugin = $this->getFactory()->createInstance($plugin_id, $configuration); // If we receive any context values via config set it into the plugin. if (!empty($configuration['context'])) { foreach ($configuration['context'] as $name => $context) { $plugin->setContextValue($name, $context); } } return $plugin->setExecutableManager($this); }
© 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!Condition!ConditionManager.php/function/ConditionManager::createInstance/8.1.x