Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MediaSourceBase.php

function MediaSourceBase::__construct

Constructs a new class instance.

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: Entity type manager service.

\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: Entity field manager service.

\Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager: The field type plugin manager service.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory service.

4 calls to MediaSourceBase::__construct()
Image::__construct in core/modules/media/src/Plugin/media/Source/Image.php
Constructs a new class instance.
Image::__construct in core/modules/media/src/Plugin/media/Source/Image.php
Constructs a new class instance.
OEmbed::__construct in core/modules/media/src/Plugin/media/Source/OEmbed.php
Constructs a new OEmbed instance.
OEmbed::__construct in core/modules/media/src/Plugin/media/Source/OEmbed.php
Constructs a new OEmbed instance.
2 methods override MediaSourceBase::__construct()
Image::__construct in core/modules/media/src/Plugin/media/Source/Image.php
Constructs a new class instance.
OEmbed::__construct in core/modules/media/src/Plugin/media/Source/OEmbed.php
Constructs a new OEmbed instance.

File

core/modules/media/src/MediaSourceBase.php, line 76

Class

MediaSourceBase
Base implementation of media source plugin.

Namespace

Drupal\media

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, FieldTypePluginManagerInterface $field_type_manager, ConfigFactoryInterface $config_factory) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->entityTypeManager = $entity_type_manager;
    $this->entityFieldManager = $entity_field_manager;
    $this->fieldTypeManager = $field_type_manager;
    $this->configFactory = $config_factory;
    // Add the default configuration of the media source to the plugin.
    $this->setConfiguration($configuration);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal