You are here

class Video in Media Migration 8

Video media migration plugin for local video media entities.

Plugin annotation


@FileEntityDealer(
  id = "video",
  types = {"video"},
  destination_media_type_id_base = "video",
  destination_media_source_plugin_id = "video_file"
)

Hierarchy

Expanded class hierarchy of Video

1 file declares its use of Video
FileEntityDealerTest.php in tests/src/Kernel/Plugin/FileEntityDealerTest.php
4 string references to 'Video'
FileEntityDealerTest::providerTestFileEntityDealer in tests/src/Kernel/Plugin/FileEntityDealerTest.php
Data provider for .
FileEntitySourceFieldInstanceTest::providerSource in tests/src/Kernel/Plugin/migrate/source/d7/FileEntitySourceFieldInstanceTest.php
The data provider.
MigrateMediaTestBase::getExpectedEntities in tests/src/Functional/MigrateMediaTestBase.php
Gets the expected entity IDs and labels per entity type after migration.
Video::getDestinationMediaTypeLabel in src/Plugin/media_migration/file_entity/Video.php

File

src/Plugin/media_migration/file_entity/Video.php, line 18

Namespace

Drupal\media_migration\Plugin\media_migration\file_entity
View source
class Video extends FileBase {

  /**
   * {@inheritdoc}
   */
  public function getDestinationMediaTypeSourceFieldLabel() {
    return 'Video file';
  }

  /**
   * {@inheritdoc}
   */
  public function getDestinationMediaTypeLabel() {
    return implode(' ', array_filter([
      'Video',
      $this->configuration['scheme'] === 'public' ? NULL : "({$this->configuration['scheme']})",
    ]));
  }

  /**
   * {@inheritdoc}
   */
  public function prepareMediaSourceFieldFormatterRow(Row $row, Connection $connection) : void {
    parent::prepareMediaSourceFieldFormatterRow($row, $connection);
    $options = [
      'type' => 'file_video',
      'settings' => [
        'muted' => FALSE,
        'width' => 640,
        'height' => 480,
      ],
    ] + $row
      ->getSourceProperty('options') ?? [];
    $row
      ->setSourceProperty('options', $options);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
FileBase::alterMediaEntityMigrationDefinition public function Overrides MediaDealerBase::alterMediaEntityMigrationDefinition 1
FileBase::getFileData protected function Returns display and description properties of the specified file.
FileBase::getFileFieldData protected function Get the name of the file fields from the source database.
FileBase::prepareMediaEntityRow public function Overrides MediaDealerBase::prepareMediaEntityRow 1
MediaDealerBase::$entityTypeManager protected property The entity type manager.
MediaDealerBase::$fieldTypeManager protected property The field type plugin manager service.
MediaDealerBase::$mediaSourceManager protected property The media source plugin manager.
MediaDealerBase::alterMediaFieldFormatterMigrationDefinition public function
MediaDealerBase::alterMediaSourceFieldInstanceMigrationDefinition public function
MediaDealerBase::alterMediaSourceFieldStorageMigrationDefinition public function
MediaDealerBase::alterMediaSourceFieldWidgetMigrationDefinition public function
MediaDealerBase::alterMediaTypeMigrationDefinition public function
MediaDealerBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create
MediaDealerBase::getDestinationMediaSourceFieldName public function 4
MediaDealerBase::getDestinationMediaSourcePluginId public function 2
MediaDealerBase::getDestinationMediaTypeId public function 1
MediaDealerBase::getDestinationMediaTypeIdBase public function 3
MediaDealerBase::getImageData protected function Returns alt, title, with and height properties of the specified file.
MediaDealerBase::getImageFieldData protected function Get the names of the image type fields from the source database.
MediaDealerBase::getMediaSourceFieldInstance protected function Returns a media source field instance.
MediaDealerBase::getMediaSourceFieldStorage protected function Returns a media source field storage.
MediaDealerBase::prepareMediaSourceFieldInstanceRow public function 2
MediaDealerBase::prepareMediaSourceFieldStorageRow public function 1
MediaDealerBase::prepareMediaSourceFieldWidgetRow public function
MediaDealerBase::prepareMediaTypeRow public function
MediaDealerBase::__construct public function Constructs a new plugin instance. Overrides PluginBase::__construct
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
Video::getDestinationMediaTypeLabel public function Overrides MediaDealerBase::getDestinationMediaTypeLabel
Video::getDestinationMediaTypeSourceFieldLabel public function Overrides MediaDealerBase::getDestinationMediaTypeSourceFieldLabel
Video::prepareMediaSourceFieldFormatterRow public function Overrides MediaDealerBase::prepareMediaSourceFieldFormatterRow