function CommentEntityTranslation::query

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

Overrides SqlBase::query

File

core/modules/comment/src/Plugin/migrate/source/d7/CommentEntityTranslation.php, line 21

Class

CommentEntityTranslation
Provides Drupal 7 comment entity translation source plugin.

Namespace

Drupal\comment\Plugin\migrate\source\d7

Code

public function query() {
    $query = $this->select('entity_translation', 'et')
        ->fields('et')
        ->fields('c', [
        'subject',
    ])
        ->condition('et.entity_type', 'comment')
        ->condition('et.source', '', '<>');
    $query->innerJoin('comment', 'c', 'c.cid = et.entity_id');
    $query->innerJoin('node', 'n', 'n.nid = c.nid');
    $query->addField('n', 'type', 'node_type');
    $query->orderBy('et.created');
    return $query;
}

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