VideoEmbedField.php in Video Embed Field 8
File
src/Plugin/migrate/cckfield/VideoEmbedField.php
View source
<?php
namespace Drupal\video_embed_field\Plugin\migrate\cckfield;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase;
class VideoEmbedField extends FieldPluginBase {
public function getFieldType(Row $row) {
return 'video_embed_field';
}
public function getFieldFormatterMap() {
return [
'default' => 'video_embed_field_video',
'video_embed_field' => 'video_embed_field_video',
'video_embed_field_thumbnail' => 'video_embed_field_thumbnail',
];
}
public function getFieldWidgetMap() {
return [
'video_embed_field_video' => 'video_embed_field_textfield',
];
}
public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'sub_process',
'source' => $field_name,
'process' => [
'value' => 'video_url',
],
];
$migration
->mergeProcessOfProperty($field_name, $process);
}
}