final class Update360 in Lightning Core 8.3
Same name and namespace in other branches
- 8.5 src/Update/Update360.php \Drupal\lightning_core\Update\Update360
- 8.4 src/Update/Update360.php \Drupal\lightning_core\Update\Update360
Plugin annotation
@Update("3.6.0");
Hierarchy
- class \Drupal\lightning_core\Update\Update360 implements ContainerInjectionInterface
Expanded class hierarchy of Update360
1 file declares its use of Update360
- Update360Test.php in tests/
src/ Kernel/ Update/ Update360Test.php
File
- src/
Update/ Update360.php, line 13
Namespace
Drupal\lightning_core\UpdateView source
final class Update360 implements ContainerInjectionInterface {
/**
* The module installer service.
*
* @var \Drupal\Core\Extension\ModuleInstallerInterface
*/
private $moduleInstaller;
/**
* Update360 constructor.
*
* @param \Drupal\Core\Extension\ModuleInstallerInterface $module_installer
* The module installer service.
*/
public function __construct(ModuleInstallerInterface $module_installer) {
$this->moduleInstaller = $module_installer;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('module_installer'));
}
/**
* @update
*
* @ask Do you want to enable pictures for user accounts?
*/
public function enableUserPictures() {
$this->moduleInstaller
->install([
'image',
]);
$config = Config::forModule('lightning_core')
->optional();
$config
->getEntity('field_storage_config', 'user.user_picture')
->save();
$config
->getEntity('field_config', 'user.user.user_picture')
->save();
$config
->getEntity('entity_view_display', 'user.user.compact')
->save();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Update360:: |
private | property | The module installer service. | |
Update360:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
Update360:: |
public | function | @update | |
Update360:: |
public | function | Update360 constructor. |