function ConfigEntity::query

Prepares query object to retrieve data from the source database.

This method should not be called directly. It is called automatically from SqlBase::prepareQuery().

Return value

\Drupal\Core\Database\Query\SelectInterface A Select query object with the source data.

Overrides SqlBase::query

File

core/modules/migrate/src/Plugin/migrate/source/ConfigEntity.php, line 58

Class

ConfigEntity
Drupal configuration source from database.

Namespace

Drupal\migrate\Plugin\migrate\source

Code

public function query() {
  $query = $this->select('config', 'c')
    ->fields('c', [
    'collection',
    'name',
    'data',
  ]);
  if (!empty($this->configuration['collections'])) {
    $query->condition('collection', (array) $this->configuration['collections'], 'IN');
  }
  if (!empty($this->configuration['names'])) {
    $query->condition('name', (array) $this->configuration['names'], 'IN');
  }
  return $query;
}

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