You are here

class MigrateEmvideoFieldHandler in Migrate Extras 6.2

Field handler.

Hierarchy

Expanded class hierarchy of MigrateEmvideoFieldHandler

File

./emfield.inc, line 28
Migrate 6.x-2.x Plugin for the Embedded Media Field module as a destination.

View source
class MigrateEmvideoFieldHandler extends MigrateFieldHandler {
  public function __construct() {
    $this
      ->registerTypes(array(
      'emvideo',
    ));
  }
  static function arguments($provider = 'youtube') {
    return array(
      'provider' => $provider,
    );
  }
  public function prepare($entity, array $instance, array $values) {
    $provider = $values['arguments']['provider'];

    // Setup the standard Field API array for saving.
    $delta = 0;
    foreach ($values as $value) {
      $item = array();
      $item['value'] = basename($value);
      $item['embed'] = $value;
      $item['provider'] = $provider;
      $return[$delta] = $item;
      $delta++;
    }
    return isset($return) ? $return : NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MigrateEmvideoFieldHandler::arguments static function
MigrateEmvideoFieldHandler::prepare public function
MigrateEmvideoFieldHandler::__construct public function Overrides MigrateHandler::__construct
MigrateHandler::$dependencies protected property List of other handler classes which should be invoked before the current one.
MigrateHandler::$typesHandled protected property List of "types" handled by this handler. Depending on the kind of handler, these may be destination types, field types, etc.
MigrateHandler::getDependencies public function
MigrateHandler::getTypesHandled public function
MigrateHandler::handlesType public function Does this handler handle the given type?
MigrateHandler::registerTypes protected function Register a list of types handled by this class