You are here

protected function MigrationListBuilder::getEntityIds in Migrate Tools 8.3

Same name and namespace in other branches
  1. 8.5 src/Controller/MigrationListBuilder.php \Drupal\migrate_tools\Controller\MigrationListBuilder::getEntityIds()
  2. 8 src/Controller/MigrationListBuilder.php \Drupal\migrate_tools\Controller\MigrationListBuilder::getEntityIds()
  3. 8.2 src/Controller/MigrationListBuilder.php \Drupal\migrate_tools\Controller\MigrationListBuilder::getEntityIds()
  4. 8.4 src/Controller/MigrationListBuilder.php \Drupal\migrate_tools\Controller\MigrationListBuilder::getEntityIds()

Retrieve the migrations belonging to the appropriate group.

Return value

array An array of entity IDs.

Overrides EntityListBuilder::getEntityIds

File

src/Controller/MigrationListBuilder.php, line 76

Class

MigrationListBuilder
Provides a listing of migration entities in a given group.

Namespace

Drupal\migrate_tools\Controller

Code

protected function getEntityIds() {
  $migration_group = $this->currentRouteMatch
    ->getParameter('migration_group');
  $query = $this
    ->getStorage()
    ->getQuery()
    ->sort($this->entityType
    ->getKey('id'));
  $migration_groups = MigrationGroup::loadMultiple();
  if (array_key_exists($migration_group, $migration_groups)) {
    $query
      ->condition('migration_group', $migration_group);
  }
  else {
    $query
      ->notExists('migration_group');
  }

  // Only add the pager if a limit is specified.
  if ($this->limit) {
    $query
      ->pager($this->limit);
  }
  return $query
    ->execute();
}