function TermDevelGenerate::create
Same name in other branches
- 4.x devel_generate/src/Plugin/DevelGenerate/TermDevelGenerate.php \Drupal\devel_generate\Plugin\DevelGenerate\TermDevelGenerate::create()
Overrides DevelGenerateBase::create
File
-
devel_generate/
src/ Plugin/ DevelGenerate/ TermDevelGenerate.php, line 74
Class
- TermDevelGenerate
- Provides a TermDevelGenerate plugin.
Namespace
Drupal\devel_generate\Plugin\DevelGenerateCode
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) : static {
$entity_type_manager = $container->get('entity_type.manager');
// @phpstan-ignore ternary.alwaysTrue (False positive)
$content_translation_manager = $container->has('content_translation.manager') ? $container->get('content_translation.manager') : NULL;
$instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);
$instance->vocabularyStorage = $entity_type_manager->getStorage('taxonomy_vocabulary');
$instance->termStorage = $entity_type_manager->getStorage('taxonomy_term');
$instance->database = $container->get('database');
$instance->contentTranslationManager = $content_translation_manager;
return $instance;
}