class LanguageContentSettings

Same name in this branch
  1. 9 core/modules/language/src/Plugin/migrate/source/d7/LanguageContentSettings.php \Drupal\language\Plugin\migrate\source\d7\LanguageContentSettings
Same name and namespace in other branches
  1. 10 core/modules/language/src/Plugin/migrate/source/d6/LanguageContentSettings.php \Drupal\language\Plugin\migrate\source\d6\LanguageContentSettings
  2. 10 core/modules/language/src/Plugin/migrate/source/d7/LanguageContentSettings.php \Drupal\language\Plugin\migrate\source\d7\LanguageContentSettings
  3. 11.x core/modules/language/src/Plugin/migrate/source/d6/LanguageContentSettings.php \Drupal\language\Plugin\migrate\source\d6\LanguageContentSettings
  4. 11.x core/modules/language/src/Plugin/migrate/source/d7/LanguageContentSettings.php \Drupal\language\Plugin\migrate\source\d7\LanguageContentSettings
  5. 8.9.x core/modules/language/src/Plugin/migrate/source/d6/LanguageContentSettings.php \Drupal\language\Plugin\migrate\source\d6\LanguageContentSettings
  6. 8.9.x core/modules/language/src/Plugin/migrate/source/d7/LanguageContentSettings.php \Drupal\language\Plugin\migrate\source\d7\LanguageContentSettings

Drupal 6 i18n node settings from database.

For available configuration keys, refer to the parent classes.

Plugin annotation


@MigrateSource(
  id = "d6_language_content_settings",
  source_module = "locale"
)

Hierarchy

Expanded class hierarchy of LanguageContentSettings

See also

\Drupal\migrate\Plugin\migrate\source\SqlBase

\Drupal\migrate\Plugin\migrate\source\SourcePluginBas

File

core/modules/language/src/Plugin/migrate/source/d6/LanguageContentSettings.php, line 21

Namespace

Drupal\language\Plugin\migrate\source\d6
View source
class LanguageContentSettings extends DrupalSqlBase {
  
  /**
   * {@inheritdoc}
   */
  public function query() {
    return $this->select('node_type', 't')
      ->fields('t', [
      'type',
    ]);
  }
  
  /**
   * {@inheritdoc}
   */
  public function fields() {
    $fields = [
      'type' => $this->t('Type'),
      'language_content_type' => $this->t('Multilingual support.'),
      'i18n_lock_node' => $this->t('Lock language.'),
    ];
    return $fields;
  }
  
  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {
    $type = $row->getSourceProperty('type');
    $row->setSourceProperty('language_content_type', $this->variableGet('language_content_type_' . $type, NULL));
    $row->setSourceProperty('i18n_lock_node', $this->variableGet('i18n_lock_node_' . $type, 0));
    return parent::prepareRow($row);
  }
  
  /**
   * {@inheritdoc}
   */
  public function getIds() {
    $ids['type']['type'] = 'string';
    return $ids;
  }

}

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