commerce_amws-8.x-1.x-dev/src/Configure/Updater/Updater9001.php
src/Configure/Updater/Updater9001.php
<?php
namespace Drupal\commerce_amws\Configure\Updater;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Extension\ModuleInstallerInterface;
/**
* Runs the 9001 updates.
*
* Installs the Entity Synchronization module.
*/
class Updater9001 {
/**
* The module handler.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* The module installer.
*
* @var \Drupal\Core\Extension\ModuleInstallerInterface
*/
protected $moduleInstaller;
/**
* Constructs a new Updater9001 object.
*
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
* @param \Drupal\Core\Extension\ModuleInstallerInterface $module_installer
* The module installer.
*/
public function __construct(
ModuleHandlerInterface $module_handler,
ModuleInstallerInterface $module_installer
) {
$this->moduleHandler = $module_handler;
$this->moduleInstaller = $module_installer;
}
/**
* Runs the updates.
*/
public function run() {
if ($this->moduleHandler->moduleExists('entity_sync')) {
return;
}
$this->moduleInstaller->install(['entity_sync']);
}
}
