You are here

public function EditorFileReference::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/editor/src/Plugin/Filter/EditorFileReference.php \Drupal\editor\Plugin\Filter\EditorFileReference::__construct()

Constructs a \Drupal\editor\Plugin\Filter\EditorFileReference 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\EntityRepositoryInterface $entity_repository: The entity repository.

\Drupal\Core\Image\ImageFactory $image_factory: The image factory.

Overrides FilterBase::__construct

File

core/modules/editor/src/Plugin/Filter/EditorFileReference.php, line 56

Class

EditorFileReference
Provides a filter to track images uploaded via a Text Editor.

Namespace

Drupal\editor\Plugin\Filter

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityRepositoryInterface $entity_repository, ImageFactory $image_factory = NULL) {
  $this->entityRepository = $entity_repository;
  if ($image_factory === NULL) {
    @trigger_error('Calling ' . __METHOD__ . '() without the $image_factory argument is deprecated in drupal:9.1.0 and is required in drupal:10.0.0. See https://www.drupal.org/node/3173719', E_USER_DEPRECATED);
    $image_factory = \Drupal::service('image.factory');
  }
  $this->imageFactory = $image_factory;
  parent::__construct($configuration, $plugin_id, $plugin_definition);
}