diff --git a/core/lib/Drupal/Core/EventSubscriber/ModuleInstallerEntitySubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ModuleInstallerEntitySubscriber.php index b6989ee..4262ecc 100644 --- a/core/lib/Drupal/Core/EventSubscriber/ModuleInstallerEntitySubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/ModuleInstallerEntitySubscriber.php @@ -40,6 +40,22 @@ class ModuleInstallerEntitySubscriber implements EventSubscriberInterface { protected $entityUpdateManager; /** + * Creates a new ModuleInstallerEntitySubscriber instance. + * + * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager + * The entity type manager. + * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager + * The entity field manager. + * @param \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface $entity_update_manager + * The entity update manager. + */ + public function __construct(\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager, \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager, \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface $entity_update_manager) { + $this->entityTypeManager = $entity_type_manager; + $this->entityFieldManager = $entity_field_manager; + $this->entityUpdateManager = $entity_update_manager; + } + + /** * Installs the required entity schema. * * @param \Drupal\Core\Extension\ModuleEvent $event @@ -82,7 +98,7 @@ public function onModuleInstall(ModuleEvent $event) { * @param \Drupal\Core\Extension\ModuleEvent $event * The module event. */ - public function onModuleUnInstall(ModuleEvent $event) { + public function onModuleUninstall(ModuleEvent $event) { $module = $event->getModule(); // Notify interested components that this module's entity types are being // deleted. For example, a SQL-based storage handler can use this as an @@ -114,7 +130,7 @@ public function onModuleUnInstall(ModuleEvent $event) { */ public static function getSubscribedEvents() { $info[ModuleEvents::MODULE_INSTALLED] = 'onModuleInstall'; - $info[ModuleEvents::MODULE_UNINSTALLED] = 'onModuleUnInstall'; + $info[ModuleEvents::MODULE_UNINSTALLED] = 'onModuleUninstall'; return $info; }