You are here

VideoItem.php in Video 8

File

src/Plugin/migrate/cckfield/VideoItem.php
View source
<?php

namespace Drupal\video\Plugin\migrate\cckfield;

use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;

/**
 * @MigrateCckField(
 *   id = "video",
 *   core = {7}
 * )
 */
class VideoItem extends CckFieldPluginBase {

  /**
   * {@inheritdoc}
   */
  public function getFieldWidgetMap() {
    return [
      'video_upload' => 'video_upload',
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getFieldFormatterMap() {
    return [
      'video_formatter_player' => 'video_player_list',
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) {
    $process = [
      'plugin' => 'iterator',
      'source' => $field_name,
      'process' => [
        'target_id' => 'fid',
      ],
    ];
    $migration
      ->mergeProcessOfProperty($field_name, $process);
  }

}

Classes

Namesort descending Description
VideoItem Plugin annotation @MigrateCckField( id = "video", core = {7} )