You are here

public function StatisticsPopularBlock::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php \Drupal\statistics\Plugin\Block\StatisticsPopularBlock::__construct()
  2. 10 core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php \Drupal\statistics\Plugin\Block\StatisticsPopularBlock::__construct()

Constructs an StatisticsPopularBlock object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The entity repository service

\Drupal\statistics\StatisticsStorageInterface $statistics_storage: The storage for statistics.

Overrides BlockPluginTrait::__construct

File

core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php, line 68

Class

StatisticsPopularBlock
Provides a 'Popular content' block.

Namespace

Drupal\statistics\Plugin\Block

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, EntityRepositoryInterface $entity_repository, StatisticsStorageInterface $statistics_storage, RendererInterface $renderer) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->entityTypeManager = $entity_type_manager;
  $this->entityRepository = $entity_repository;
  $this->statisticsStorage = $statistics_storage;
  $this->renderer = $renderer;
}