public function NameOptionsProvider::__construct in Name Field 8
Constructs a new NameOptionsProvider object.
Parameters
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.
File
- src/
NameOptionsProvider.php, line 57
Class
- NameOptionsProvider
- The name option provider for the name field.
Namespace
Drupal\nameCode
public function __construct(EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler) {
$this->entityTypeManager = $entity_type_manager;
$this->moduleHandler = $module_handler;
if ($this->entityTypeManager && $this->moduleHandler
->moduleExists('taxonomy')) {
$this->termStorage = $this->entityTypeManager
->getStorage('taxonomy_term');
$this->vocabularyStorage = $this->entityTypeManager
->getStorage('taxonomy_vocabulary');
}
}