public function DeclaredEmailManager::createInstance in Easy Email 8
Same name and namespace in other branches
- 2.0.x modules/easy_email_override/src/Service/DeclaredEmailManager.php \Drupal\easy_email_override\Service\DeclaredEmailManager::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
File
- modules/
easy_email_override/ src/ Service/ DeclaredEmailManager.php, line 84
Class
- DeclaredEmailManager
- Manages discovery and instantiation of email plugins.
Namespace
Drupal\easy_email_override\ServiceCode
public function createInstance($plugin_id, array $configuration = array()) {
$plugin_definition = $this
->getDefinition($plugin_id);
return new Email($configuration, $plugin_id, $plugin_definition);
}