protected function Recipe71::handleTranslations in Recipe 8.2
Adapt our query for translations.
Parameters
\Drupal\Core\Database\Query\SelectInterface $query: The generated query.
1 call to Recipe71::handleTranslations()
- Recipe71::query in src/
Plugin/ migrate/ source/ recipe71/ Recipe71.php
File
- src/
Plugin/ migrate/ source/ recipe71/ Recipe71.php, line 99
Class
- Recipe71
- Drupal 7 recipe source from database.
Namespace
Drupal\recipe\Plugin\migrate\source\recipe71Code
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');
}
}