You are here

protected function DrupalComment7Migration::query in Drupal-to-Drupal data migration 7.2

Implementation of DrupalCommentMigration::query().

We join to {node} so that we can use separate comment migration classes for each associated node type.

Return value

SelectQueryInterface

Overrides DrupalMigration::query

File

d7/comment.inc, line 41
Implementation of DrupalCommentMigration for Drupal 7 sources.

Class

DrupalComment7Migration
Handling specific to a Drupal 7 source for comments.

Code

protected function query() {
  $query = Database::getConnection('default', $this->sourceConnection)
    ->select('comment', 'c')
    ->fields('c', array(
    'cid',
    'pid',
    'nid',
    'uid',
    'subject',
    'hostname',
    'created',
    'changed',
    'status',
    'thread',
    'name',
    'mail',
    'homepage',
    'language',
  ));
  $query
    ->join('node', 'n', 'c.nid = n.nid');
  $query
    ->condition('n.type', $this->sourceType)
    ->orderBy('c.changed');
  return $query;
}