You are here

protected function MigrationCreationTrait::getSystemData in Migrate Upgrade 8

Gets the system data from the system table of the source Drupal database.

Parameters

array $database: Database array representing the source Drupal database.

Return value

array The system data from the system table of the source Drupal database.

1 call to MigrationCreationTrait::getSystemData()
MigrateUpgradeForm::validateCredentialForm in src/Form/MigrateUpgradeForm.php
Validation handler for the credentials form.

File

src/MigrationCreationTrait.php, line 47
Contains \Drupal\migrate_upgrade\MigrationCreationTrait.

Class

MigrationCreationTrait
Creates the appropriate migrations for a given source Drupal database.

Namespace

Drupal\migrate_upgrade

Code

protected function getSystemData(array $database) {
  $connection = $this
    ->getConnection($database);
  $system_data = [];
  try {
    $results = $connection
      ->select('system', 's', [
      'fetch' => \PDO::FETCH_ASSOC,
    ])
      ->fields('s')
      ->execute();
    foreach ($results as $result) {
      $system_data[$result['type']][$result['name']] = $result;
    }
  } catch (\Exception $e) {

    // The table might not exist for example in tests.
  }
  return $system_data;
}