You are here

public function EntityUsageBase::__construct in Entity Usage 8.4

Plugin constructor.

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\entity_usage\EntityUsageInterface $usage_service: The usage storage service.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The EntityTypeManager service.

\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: The EntityFieldManager service.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The factory for configuration objects.

\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The EntityRepositoryInterface service.

2 calls to EntityUsageBase::__construct()
HtmlLink::__construct in src/Plugin/EntityTrack/Track/HtmlLink.php
Constructs the HtmlLink plugin.
LayoutBuilder::__construct in src/Plugin/EntityTrack/Track/LayoutBuilder.php
Constructs a new LayoutBuilder plugin instance.
2 methods override EntityUsageBase::__construct()
HtmlLink::__construct in src/Plugin/EntityTrack/Track/HtmlLink.php
Constructs the HtmlLink plugin.
LayoutBuilder::__construct in src/Plugin/EntityTrack/Track/LayoutBuilder.php
Constructs a new LayoutBuilder plugin instance.

File

src/EntityUsageBase.php, line 61

Class

EntityUsageBase
Base implementation for track plugins.

Namespace

Drupal\entity_usage

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityUsageInterface $usage_service, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, ConfigFactoryInterface $config_factory, EntityRepositoryInterface $entity_repository) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $entity_field_manager, $config_factory, $entity_repository);
  $this->configuration += $this
    ->defaultConfiguration();
  $this->usageService = $usage_service;
  $this->entityRepository = $entity_repository;
  $this->usageConfig = $config_factory
    ->get('entity_usage.settings');
}