You are here

public function EntityProcessorPluginManager::createInstance in Content Synchronizer 8.2

Same name and namespace in other branches
  1. 8 src/Processors/Entity/EntityProcessorPluginManager.php \Drupal\content_synchronizer\Processors\Entity\EntityProcessorPluginManager::createInstance()
  2. 3.x src/Processors/Entity/EntityProcessorPluginManager.php \Drupal\content_synchronizer\Processors\Entity\EntityProcessorPluginManager::createInstance()

Creates a pre-configured instance of a plugin.

Parameters

string $plugin_id: The ID of the plugin being instantiated.

array $configuration: An array of configuration relevant to the plugin instance.

Return value

object A fully configured plugin instance.

Throws

\Drupal\Component\Plugin\Exception\PluginException If the instance cannot be created, such as if the ID is invalid.

Overrides PluginManagerBase::createInstance

1 call to EntityProcessorPluginManager::createInstance()
EntityProcessorPluginManager::getInstanceByEntityType in src/Processors/Entity/EntityProcessorPluginManager.php
Get the plugin by bundle type.

File

src/Processors/Entity/EntityProcessorPluginManager.php, line 62

Class

EntityProcessorPluginManager
The entity processor plugin manager.

Namespace

Drupal\content_synchronizer\Processors\Entity

Code

public function createInstance($plugin_id, array $configuration = []) {
  if (!array_key_exists($plugin_id, static::$instances)) {
    static::$instances[$plugin_id] = parent::createInstance($plugin_id, $configuration);
  }
  return static::$instances[$plugin_id];
}