function NodeEntityTranslation::query

Same name in other branches
  1. 8.9.x core/modules/node/src/Plugin/migrate/source/d7/NodeEntityTranslation.php \Drupal\node\Plugin\migrate\source\d7\NodeEntityTranslation::query()
  2. 10 core/modules/node/src/Plugin/migrate/source/d7/NodeEntityTranslation.php \Drupal\node\Plugin\migrate\source\d7\NodeEntityTranslation::query()
  3. 11.x core/modules/node/src/Plugin/migrate/source/d7/NodeEntityTranslation.php \Drupal\node\Plugin\migrate\source\d7\NodeEntityTranslation::query()

Overrides SqlBase::query

File

core/modules/node/src/Plugin/migrate/source/d7/NodeEntityTranslation.php, line 49

Class

NodeEntityTranslation
Drupal 7 node entity translations source from database.

Namespace

Drupal\node\Plugin\migrate\source\d7

Code

public function query() {
    $query = $this->select('entity_translation', 'et')
        ->fields('et')
        ->fields('n', [
        'title',
        'type',
        'promote',
        'sticky',
    ])
        ->fields('nr', [
        'log',
        'timestamp',
    ])
        ->condition('et.entity_type', 'node')
        ->condition('et.source', '', '<>');
    $query->addField('nr', 'uid', 'revision_uid');
    $query->innerJoin('node', 'n', '[n].[nid] = [et].[entity_id]');
    $query->innerJoin('node_revision', 'nr', '[nr].[vid] = [et].[revision_id]');
    if (isset($this->configuration['node_type'])) {
        $query->condition('n.type', (array) $this->configuration['node_type'], 'IN');
    }
    return $query;
}

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