Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Node.php

function Node::query

Same name in this branch
  1. 11.1.x core/modules/node/src/Plugin/migrate/source/d7/Node.php \Drupal\node\Plugin\migrate\source\d7\Node::query()

Overrides SqlBase::query

2 calls to Node::query()
NodeComplete::query in core/modules/node/src/Plugin/migrate/source/d6/NodeComplete.php
NodeComplete::query in core/modules/node/src/Plugin/migrate/source/d6/NodeComplete.php
1 method overrides Node::query()
NodeComplete::query in core/modules/node/src/Plugin/migrate/source/d6/NodeComplete.php

File

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

Class

Node
Drupal 6 node source from database.

Namespace

Drupal\node\Plugin\migrate\source\d6

Code

public function query() {
    $query = $this->select('node_revisions', 'nr');
    $query->innerJoin('node', 'n', static::JOIN);
    $this->handleTranslations($query);
    $query->fields('n', [
        'nid',
        'type',
        'language',
        'status',
        'created',
        'changed',
        'comment',
        'promote',
        'moderate',
        'sticky',
        'tnid',
        'translate',
    ])
        ->fields('nr', [
        'title',
        'body',
        'teaser',
        'log',
        'timestamp',
        'format',
        'vid',
    ]);
    $query->addField('n', 'uid', 'node_uid');
    $query->addField('nr', 'uid', 'revision_uid');
    // If the content_translation module is enabled, get the source langcode
    // to fill the content_translation_source field.
    if ($this->moduleHandler
        ->moduleExists('content_translation')) {
        $query->leftJoin('node', 'nt', '[n].[tnid] = [nt].[nid]');
        $query->addField('nt', 'language', 'source_langcode');
    }
    if (isset($this->configuration['node_type'])) {
        $query->condition('n.type', (array) $this->configuration['node_type'], 'IN');
    }
    return $query;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal