You are here

public function ParagraphsItem::query in Paragraphs 8

Return value

\Drupal\Core\Database\Query\SelectInterface

Overrides SqlBase::query

File

src/Plugin/migrate/source/d7/ParagraphsItem.php, line 48

Class

ParagraphsItem
Paragraphs Item source plugin.

Namespace

Drupal\paragraphs\Plugin\migrate\source\d7

Code

public function query() {
  $query = $this
    ->select('paragraphs_item', 'p')
    ->fields('p', [
    'item_id',
    'bundle',
    'field_name',
    'archived',
  ])
    ->fields('pr', [
    'revision_id',
  ]);
  $query
    ->innerJoin('paragraphs_item_revision', 'pr', static::JOIN);

  // This configuration item may be set by a deriver to restrict the
  // bundles retrieved.
  if ($this->configuration['bundle']) {
    $query
      ->condition('p.bundle', $this->configuration['bundle']);
  }
  return $query;
}