Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Language.php

function Language::prepareRow

Overrides SourcePluginBase::prepareRow

File

core/modules/language/src/Plugin/migrate/source/Language.php, line 83

Class

Language
Drupal 6/7 language source from database.

Namespace

Drupal\language\Plugin\migrate\source

Code

public function prepareRow(Row $row) {
    if (!empty($this->configuration['fetch_all'])) {
        // Get an array of all languages.
        $languages = $this->query()
            ->execute()
            ->fetchAll();
        $row->setSourceProperty('languages', $languages);
    }
    if (!empty($this->configuration['domain_negotiation'])) {
        // Check if domain negotiation is used to be able to fill in the default
        // language domain, which may be empty. In D6, domain negotiation is used
        // when the 'language_negotiation' variable is set to '3', and in D7, when
        // the 'locale_language_negotiation_url_part' variable is set to '1'.
        if ($this->variableGet('language_negotiation', 0) == 3 || $this->variableGet('locale_language_negotiation_url_part', 0) == 1) {
            $row->setSourceProperty('domain_negotiation_used', TRUE);
        }
    }
    return parent::prepareRow($row);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal