You are here

protected function MigrateRedirectEntityHandler::getRedirectLanguage in Redirect 7.2

Same name and namespace in other branches
  1. 7 redirect.migrate.inc \MigrateRedirectEntityHandler::getRedirectLanguage()

Determine the language for the current redirect.

Look for a language setting in this order:

  • specified in the migration mapping
  • migration-specific language defined on the entity
  • entity language
  • default to LANGUAGE_NONE.

Parameters

object $entity: The Drupal entity.

object $row: The row being migrated.

Return value

string a language code

1 call to MigrateRedirectEntityHandler::getRedirectLanguage()
MigrateRedirectEntityHandler::complete in ./redirect.migrate.inc
Overrides complete().

File

./redirect.migrate.inc, line 107
Migrate support for Redirect module.

Class

MigrateRedirectEntityHandler
@file Migrate support for Redirect module.

Code

protected function getRedirectLanguage($entity, $row) {
  if (!empty($row->migrate_redirects_language)) {
    $language = $row->migrate_redirects_language;
  }
  elseif (!empty($entity->migrate_redirects_language)) {
    $language = $entity->migrate_redirects_language;
  }
  elseif (!empty($entity->language)) {
    $language = $entity->language;
  }
  else {
    $language = LANGUAGE_NONE;
  }
  return $language;
}