abstract class RemoteVideoBase in Media Migration 8
Abstract plugin class for remote video media migration source plugins.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\media_migration\MediaDealerBase implements ContainerFactoryPluginInterface
- class \Drupal\media_migration\FileEntityDealerBase implements FileEntityDealerPluginInterface
- class \Drupal\media_migration\Plugin\media_migration\file_entity\RemoteVideoBase
- class \Drupal\media_migration\FileEntityDealerBase implements FileEntityDealerPluginInterface
- class \Drupal\media_migration\MediaDealerBase implements ContainerFactoryPluginInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of RemoteVideoBase
File
- src/
Plugin/ media_migration/ file_entity/ RemoteVideoBase.php, line 12
Namespace
Drupal\media_migration\Plugin\media_migration\file_entityView source
abstract class RemoteVideoBase extends FileEntityDealerBase {
/**
* {@inheritdoc}
*/
public function getDestinationMediaTypeIdBase() {
return 'remote_video';
}
/**
* {@inheritdoc}
*/
public function getDestinationMediaTypeId() {
return $this
->getDestinationMediaTypeIdBase();
}
/**
* {@inheritdoc}
*/
public function getDestinationMediaTypeSourceFieldLabel() {
return 'Video URL';
}
/**
* {@inheritdoc}
*/
public function getDestinationMediaTypeLabel() {
return 'Remote video';
}
/**
* {@inheritdoc}
*/
public function getDestinationMediaSourceFieldName() {
return 'field_media_oembed_video';
}
/**
* {@inheritdoc}
*/
public function alterMediaEntityMigrationDefinition(array &$migration_definition, Connection $connection) : void {
$migration_definition['process'][$this
->getDestinationMediaSourceFieldName() . '/value'] = [
'plugin' => 'media_internet_field_value',
'source' => 'uri',
];
}
/**
* {@inheritdoc}
*/
public function prepareMediaSourceFieldFormatterRow(Row $row, Connection $connection) : void {
parent::prepareMediaSourceFieldFormatterRow($row, $connection);
$options = [
'type' => 'oembed',
] + $row
->getSourceProperty('options') ?? [];
$row
->setSourceProperty('options', $options);
}
}