You are here

public function HtmlLink::__construct in Entity Usage 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/EntityUsage/Track/HtmlLink.php \Drupal\entity_usage\Plugin\EntityUsage\Track\HtmlLink::__construct()

Constructs the HtmlLink plugin.

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\EntityUsage $usage_service: The usage tracking 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.

\Drupal\Core\Path\PathValidatorInterface $path_validator: The Drupal Path Validator service.

\Drupal\Core\StreamWrapper\StreamWrapperInterface $public_stream: The Public Stream service.

Overrides EntityUsageTrackBase::__construct

File

src/Plugin/EntityUsage/Track/HtmlLink.php, line 65

Class

HtmlLink
Tracks usage of entities referenced from regular HTML Links.

Namespace

Drupal\entity_usage\Plugin\EntityUsage\Track

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityUsage $usage_service, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, ConfigFactoryInterface $config_factory, EntityRepositoryInterface $entity_repository, PathValidatorInterface $path_validator, StreamWrapperInterface $public_stream) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $usage_service, $entity_type_manager, $entity_field_manager, $config_factory, $entity_repository);
  $this->pathValidator = $path_validator;
  $this->publicFileDirectory = method_exists($public_stream, 'getDirectoryPath') ? $public_stream
    ->getDirectoryPath() : '';
}