You are here

final class Update310 in Lightning Media 8.4

Same name and namespace in other branches
  1. 8.3 src/Update/Update310.php \Drupal\lightning_media\Update\Update310

Contains optional updates targeting Lightning Media 3.1.0.

Plugin annotation

@Update("3.1.0");

Hierarchy

Expanded class hierarchy of Update310

File

src/Update/Update310.php, line 14

Namespace

Drupal\lightning_media\Update
View source
final class Update310 implements ContainerInjectionInterface {

  /**
   * The module installer.
   *
   * @var \Drupal\Core\Extension\ModuleInstallerInterface
   */
  protected $moduleInstaller;

  /**
   * Update310 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'));
  }

  /**
   * Enables the Media Slideshow sub-component.
   *
   * @update
   *
   * @ask Do you want to add support for creating slideshows and carousels
   * of media assets?
   */
  public function enableMediaSlideshow() {
    $this->moduleInstaller
      ->install([
      'lightning_media_slideshow',
    ]);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Update310::$moduleInstaller protected property The module installer.
Update310::create public static function Instantiates a new instance of this class. Overrides ContainerInjectionInterface::create
Update310::enableMediaSlideshow public function Enables the Media Slideshow sub-component.
Update310::__construct public function Update310 constructor.