function LanguageNegotiation::mapNewMethods

Same name and namespace in other branches
  1. 9 core/modules/language/src/Plugin/migrate/process/LanguageNegotiation.php \Drupal\language\Plugin\migrate\process\LanguageNegotiation::mapNewMethods()
  2. 8.9.x core/modules/language/src/Plugin/migrate/process/LanguageNegotiation.php \Drupal\language\Plugin\migrate\process\LanguageNegotiation::mapNewMethods()
  3. 10 core/modules/language/src/Plugin/migrate/process/LanguageNegotiation.php \Drupal\language\Plugin\migrate\process\LanguageNegotiation::mapNewMethods()

Maps old negotiation method names to the new ones.

Parameters

string $value: The old negotiation method name.

Return value

string The new negotiation method name.

1 call to LanguageNegotiation::mapNewMethods()
LanguageNegotiation::transform in core/modules/language/src/Plugin/migrate/process/LanguageNegotiation.php
Performs the associated process.

File

core/modules/language/src/Plugin/migrate/process/LanguageNegotiation.php, line 60

Class

LanguageNegotiation
Processes the arrays for the language types' negotiation methods and weights.

Namespace

Drupal\language\Plugin\migrate\process

Code

protected function mapNewMethods($value) {
    switch ($value) {
        case 'language-default':
            return 'language-selected';
        case 'locale-browser':
            return 'language-browser';
        case 'locale-interface':
            return 'language-interface';
        case 'locale-session':
            return 'language-session';
        case 'locale-url':
            return 'language-url';
        case 'locale-url-fallback':
            return 'language-url-fallback';
        case 'locale-user':
            return 'language-user';
        default:
            return $value;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.