final class Update310 in Lightning Workflow 8.3
Contains optional updates targeting Lightning Workflow 3.1.0.
Plugin annotation
@Update("3.1.0");
Hierarchy
- class \Drupal\lightning_workflow\Update\Update310 implements ContainerInjectionInterface uses StringTranslationTrait
Expanded class hierarchy of Update310
File
- src/
Update/ Update310.php, line 17
Namespace
Drupal\lightning_workflow\UpdateView source
final class Update310 implements ContainerInjectionInterface {
use StringTranslationTrait;
/**
* The module installer.
*
* @var \Drupal\Core\Extension\ModuleInstallerInterface
*/
private $moduleInstaller;
/**
* The config factory service.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
private $configFactory;
/**
* Update310 constructor.
*
* @param \Drupal\Core\Extension\ModuleInstallerInterface $module_installer
* The module installer.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
*/
public function __construct(ModuleInstallerInterface $module_installer, ConfigFactoryInterface $config_factory) {
$this->moduleInstaller = $module_installer;
$this->configFactory = $config_factory;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('module_installer'), $container
->get('config.factory'));
}
/**
* Enables the Moderation Dashboard module.
*
* @param \Symfony\Component\Console\Style\StyleInterface $io
* The I/O handler.
*
* @update
*
* @ask Do you want to enable the Moderation Dashboard module?
*/
public function enableModerationDashboard(StyleInterface $io) {
$installed = $this->moduleInstaller
->install([
'moderation_dashboard',
]);
if ($installed) {
$question = (string) $this
->t('Do you want users with the appropriate permissions to be redirected to the moderation dashboard when they log in?');
$this->configFactory
->getEditable('moderation_dashboard.settings')
->set('redirect_on_login', $io
->confirm($question, FALSE))
->save();
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
Update310:: |
private | property | The config factory service. | |
Update310:: |
private | property | The module installer. | |
Update310:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
Update310:: |
public | function | Enables the Moderation Dashboard module. | |
Update310:: |
public | function | Update310 constructor. |