You are here

public function SliderBlock::__construct in Image sliders 8

Same name in this branch
  1. 8 src/Plugin/Derivative/SliderBlock.php \Drupal\image_slider\Plugin\Derivative\SliderBlock::__construct()
  2. 8 src/Plugin/Block/SliderBlock.php \Drupal\image_slider\Plugin\Block\SliderBlock::__construct()

Construct a MyFormatter object.

Parameters

array $configuration: This is configuration.

string $plugin_id: This is plugin.

mixed $plugin_definition: This is plugin defination.

\Drupal\Core\Database\Connection $database: The database connection.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity: Entity type manager service.

Overrides BlockPluginTrait::__construct

File

src/Plugin/Block/SliderBlock.php, line 53

Class

SliderBlock
Provides a block.

Namespace

Drupal\image_slider\Plugin\Block

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, Connection $database, EntityTypeManagerInterface $entity) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->database = $database;
  $this->fileStorage = $entity
    ->getStorage('file');
}