public function Container::createInstance in Service Container 7.2
Same name and namespace in other branches
- 7 src/DependencyInjection/Container.php \Drupal\service_container\DependencyInjection\Container::createInstance()
File
- src/
DependencyInjection/ Container.php, line 24 - Contains \Drupal\service_container\DependencyInjection\Container
Class
- Container
- Container is a DI container that provides services to users of the class.
Namespace
Drupal\service_container\DependencyInjectionCode
public function createInstance($plugin_id, $service_definition) {
$temporary_name = 'plugin_' . $plugin_id;
$this->serviceDefinitions[$temporary_name] = $service_definition;
$plugin = $this
->get($temporary_name);
unset($this->serviceDefinitions[$temporary_name]);
unset($this->services[$temporary_name]);
return $plugin;
}