You are here

class MigrateLanguagefieldFieldHandler in Custom Language field 7

Migrate field handler for language fields.

Hierarchy

Expanded class hierarchy of MigrateLanguagefieldFieldHandler

1 string reference to 'MigrateLanguagefieldFieldHandler'
languagefield_migrate_api in ./languagefield.module
Implements hook_migrate_api().

File

./languagefield.migrate.inc, line 16
Contains the MigrateLanguagefieldFieldHandler class.

View source
class MigrateLanguagefieldFieldHandler extends MigrateSimpleFieldHandler {

  /**
   * {@inheritdoc}
   */
  public function __construct() {
    parent::__construct();
    $this
      ->registerTypes(array(
      'language_field',
    ));
  }

  /**
   * {@inheritdoc}
   */
  public function prepare($entity, array $field_info, array $instance, array $values) {

    // Get the options for this field.
    $options = languagefield_options_list($field_info, $instance, $entity->type, $entity);

    // Filter out values that are not in the options.
    $values = array_intersect($values, array_keys($options));
    return parent::prepare($entity, $field_info, $instance, $values);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MigrateFieldHandler::getFieldLanguage function Determine the language of the field.
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? 1
MigrateHandler::registerTypes protected function Register a list of types handled by this class
MigrateLanguagefieldFieldHandler::prepare public function Overrides MigrateSimpleFieldHandler::prepare
MigrateLanguagefieldFieldHandler::__construct public function Construct a simple field handler. Overrides MigrateSimpleFieldHandler::__construct
MigrateSimpleFieldHandler::$fieldValueKey protected property
MigrateSimpleFieldHandler::$skipEmpty protected property
MigrateSimpleFieldHandler::notNull protected function Returns TRUE only for values which are not NULL. 2