You are here

protected function Node::handleTranslations in Drupal 8

Same name in this branch
  1. 8 core/modules/node/src/Plugin/migrate/source/d6/Node.php \Drupal\node\Plugin\migrate\source\d6\Node::handleTranslations()
  2. 8 core/modules/node/src/Plugin/migrate/source/d7/Node.php \Drupal\node\Plugin\migrate\source\d7\Node::handleTranslations()
Same name and namespace in other branches
  1. 9 core/modules/node/src/Plugin/migrate/source/d6/Node.php \Drupal\node\Plugin\migrate\source\d6\Node::handleTranslations()
  2. 10 core/modules/node/src/Plugin/migrate/source/d6/Node.php \Drupal\node\Plugin\migrate\source\d6\Node::handleTranslations()

Adapt our query for translations.

Parameters

\Drupal\Core\Database\Query\SelectInterface $query: The generated query.

1 call to Node::handleTranslations()
Node::query in core/modules/node/src/Plugin/migrate/source/d6/Node.php
1 method overrides Node::handleTranslations()
NodeRevision::handleTranslations in core/modules/node/src/Plugin/migrate/source/d6/NodeRevision.php
Adapt our query for translations.

File

core/modules/node/src/Plugin/migrate/source/d6/Node.php, line 328

Class

Node
Drupal 6 node source from database.

Namespace

Drupal\node\Plugin\migrate\source\d6

Code

protected function handleTranslations(SelectInterface $query) {

  // Check whether or not we want translations.
  if (empty($this->configuration['translations'])) {

    // No translations: Yield untranslated nodes, or default translations.
    $query
      ->where('n.tnid = 0 OR n.tnid = n.nid');
  }
  else {

    // Translations: Yield only non-default translations.
    $query
      ->where('n.tnid <> 0 AND n.tnid <> n.nid');
  }
}