You are here

public static function MigrateTools::buildIdList in Migrate Tools 8.5

Same name and namespace in other branches
  1. 8.4 src/MigrateTools.php \Drupal\migrate_tools\MigrateTools::buildIdList()

Build the list of specific source IDs to import.

Parameters

array $options: The migration executable options.

Return value

array The ID list.

4 calls to MigrateTools::buildIdList()
MigrateExecutable::__construct in src/MigrateExecutable.php
Constructs a MigrateExecutable and verifies and sets the memory limit.
MigrateToolsCommands::executeMigration in src/Commands/MigrateToolsCommands.php
Executes a single migration.
MigrateToolsCommands::messages in src/Commands/MigrateToolsCommands.php
View any messages associated with a migration.
MigrateToolsTest::testBuildIdList in tests/src/Unit/MigrateToolsTest.php
@covers ::buildIdList

File

src/MigrateTools.php, line 24

Class

MigrateTools
Utility functionality for use in migrate_tools.

Namespace

Drupal\migrate_tools

Code

public static function buildIdList(array $options) {
  $options += [
    'idlist' => NULL,
    'idlist-delimiter' => self::DEFAULT_ID_LIST_DELIMITER,
  ];
  $id_list = [];
  if ($options['idlist']) {
    $id_list = explode(',', $options['idlist']);
    array_walk($id_list, function (&$value) use ($options) {
      $value = str_getcsv($value, $options['idlist-delimiter']);
    });
  }
  return $id_list;
}