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",
15 class LanguageContentSettings extends DrupalSqlBase {
20 public function query() {
21 return $this->select('node_type', 't')
30 public function fields() {
32 'type' => $this->t('Type'),
33 'language_content_type' => $this->t('Multilingual support.'),
34 'i18n_lock_node' => $this->t('Lock language.'),
42 public function prepareRow(Row $row) {
43 $type = $row->getSourceProperty('type');
44 $row->setSourceProperty('language_content_type', $this->variableGet('language_content_type_' . $type, NULL));
45 $i18n_node_options = $this->variableGet('i18n_node_options_' . $type, NULL);
46 if ($i18n_node_options && in_array('lock', $i18n_node_options)) {
47 $row->setSourceProperty('i18n_lock_node', 1);
50 $row->setSourceProperty('i18n_lock_node', 0);
52 return parent::prepareRow($row);
58 public function getIds() {
59 $ids['type']['type'] = 'string';