function ContentEntity::query

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

Query to retrieve the entities.

Return value

\Drupal\Core\Entity\Query\QueryInterface The query.

File

core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php, line 223

Class

ContentEntity
Source plugin to get content entities from the current version of Drupal.

Namespace

Drupal\migrate_drupal\Plugin\migrate\source

Code

public function query() {
    $query = $this->entityTypeManager
        ->getStorage($this->entityType
        ->id())
        ->getQuery()
        ->accessCheck(FALSE);
    if (!empty($this->configuration['bundle'])) {
        $query->condition($this->entityType
            ->getKey('bundle'), $this->configuration['bundle']);
    }
    return $query;
}

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