You are here

public function PhotoswipeFieldFormatter::__construct in PhotoSwipe 3.x

Constructs a FormatterBase object.

Parameters

string $plugin_id: The plugin_id for the formatter.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The definition of the field to which the formatter is associated.

array $settings: The formatter settings.

string $label: The formatter label display setting.

string $view_mode: The view mode.

array $third_party_settings: Any third party settings.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: The entity field manager.

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

\Drupal\photoswipe\PhotoswipeAssetsManagerInterface $assets_manager: The assets manager.

Overrides FormatterBase::__construct

File

src/Plugin/Field/FieldFormatter/PhotoswipeFieldFormatter.php, line 107

Class

PhotoswipeFieldFormatter
Plugin implementation of the 'photoswipe_field_formatter' formatter.

Namespace

Drupal\photoswipe\Plugin\Field\FieldFormatter

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, ModuleHandlerInterface $module_handler, EntityFieldManagerInterface $entity_field_manager, EntityRepositoryInterface $entity_repository, PhotoswipeAssetsManagerInterface $assets_manager) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
  $this->fieldDefinition = $field_definition;
  $this->settings = $settings;
  $this->label = $label;
  $this->viewMode = $view_mode;
  $this->thirdPartySettings = $third_party_settings;
  $this->moduleHandler = $module_handler;
  $this->entityFieldManager = $entity_field_manager;
  $this->entityRepository = $entity_repository;
  $this->photoswipeAssetManager = $assets_manager;
}