You are here

public function CommentEntityTranslation::query in Drupal 9

Same name and namespace in other branches
  1. 8 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()

Return value

\Drupal\Core\Database\Query\SelectInterface

Overrides SqlBase::query

File

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

Class

CommentEntityTranslation
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;
}