You are here

hms_field.migrate.inc in HMS Field 7

Same filename and directory in other branches
  1. 8 hms_field.migrate.inc

Support for the Migrate API.

File

hms_field.migrate.inc
View source
<?php

/**
 * @file
 * Support for the Migrate API.
 */

/**
 * Migrate handler for HMS fields, so we can import values to these fields.
 * You should give the integer (seconds) value to the mapping.
 */
class MigrateHmsFieldHandler extends MigrateSimpleFieldHandler {

  /**
   * This does all the work. Mainly register the field type.
   */
  public function __construct() {
    parent::__construct(array(
      'value_key' => 'value',
      'skip_empty' => FALSE,
    ));
    $this
      ->registerTypes(array(
      'hms_field',
    ));
  }

}

/**
 * Let's tell migrate that we have implementation above.
 * Implements migrate hook_migrate_api().
 */
function hms_field_migrate_api() {
  $api = array(
    'api' => 2,
  );
  return $api;
}

Functions

Namesort descending Description
hms_field_migrate_api Let's tell migrate that we have implementation above. Implements migrate hook_migrate_api().

Classes

Namesort descending Description
MigrateHmsFieldHandler Migrate handler for HMS fields, so we can import values to these fields. You should give the integer (seconds) value to the mapping.