3 namespace Drupal\language\Plugin\migrate\source\d7;
5 use Drupal\migrate\Row;
6 use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
9 * Drupal multilingual node settings from database.
12 * id = "d7_language_content_settings",
13 * source_module = "locale"
16 class LanguageContentSettings extends DrupalSqlBase {
21 public function query() {
22 return $this->select('node_type', 't')
31 public function fields() {
33 'type' => $this->t('Type'),
34 'language_content_type' => $this->t('Multilingual support.'),
35 'i18n_lock_node' => $this->t('Lock language.'),
43 public function prepareRow(Row $row) {
44 $type = $row->getSourceProperty('type');
45 $row->setSourceProperty('language_content_type', $this->variableGet('language_content_type_' . $type, NULL));
46 $i18n_node_options = $this->variableGet('i18n_node_options_' . $type, NULL);
47 if ($i18n_node_options && in_array('lock', $i18n_node_options)) {
48 $row->setSourceProperty('i18n_lock_node', 1);
51 $row->setSourceProperty('i18n_lock_node', 0);
53 return parent::prepareRow($row);
59 public function getIds() {
60 $ids['type']['type'] = 'string';