ContainerFactory.php in Plug 7
File
lib/Drupal/Core/Plugin/Factory/ContainerFactory.php
View source
<?php
namespace Drupal\Core\Plugin\Factory;
use Drupal\Component\Plugin\Factory\DefaultFactory;
class ContainerFactory extends DefaultFactory {
public function createInstance($plugin_id, array $configuration = array()) {
$plugin_definition = $this->discovery
->getDefinition($plugin_id);
$plugin_class = static::getPluginClass($plugin_id, $plugin_definition, $this->interface);
if (is_subclass_of($plugin_class, 'Drupal\\Core\\Plugin\\ContainerFactoryPluginInterface')) {
return $plugin_class::create(\Drupal::getContainer(), $configuration, $plugin_id, $plugin_definition);
}
return new $plugin_class($configuration, $plugin_id, $plugin_definition);
}
}