You are here

function MigrateFieldHandler::getFieldLanguage in Migrate 7.2

Determine the language of the field.

Parameters

$entity:

$field_info:

$arguments:

Return value

string language code.

5 calls to MigrateFieldHandler::getFieldLanguage()
MigrateDefaultFieldHandler::prepare in plugins/destinations/fields.inc
Implements MigrateFieldHandler::prepare().
MigrateFileFieldBaseHandler::prepare in plugins/destinations/fields.inc
Implementation of MigrateFieldHandler::prepare().
MigrateSimpleFieldHandler::prepare in plugins/destinations/fields.inc
MigrateTaxonomyTermReferenceFieldHandler::prepare in plugins/destinations/fields.inc
MigrateTextFieldHandler::prepare in plugins/destinations/fields.inc

File

plugins/destinations/fields.inc, line 129
Support for processing entity fields

Class

MigrateFieldHandler

Code

function getFieldLanguage($entity, $field_info, array $arguments) {
  $migration = Migration::currentMigration();
  switch (TRUE) {
    case !field_is_translatable($migration
      ->getDestination()
      ->getEntityType(), $field_info):
      return LANGUAGE_NONE;
    case isset($arguments['language']):
      return $arguments['language'];
    case !empty($entity->language) && $entity->language != LANGUAGE_NONE:
      return $entity->language;
      break;
    default:
      return $migration
        ->getDestination()
        ->getLanguage();
  }
}