You are here

protected function MigrationConfigurationTrait::getSystemData in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate_drupal/src/MigrationConfigurationTrait.php \Drupal\migrate_drupal\MigrationConfigurationTrait::getSystemData()

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

Parameters

\Drupal\Core\Database\Connection $connection: Database connection to the source Drupal database.

Return value

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

1 call to MigrationConfigurationTrait::getSystemData()
CredentialForm::setupMigrations in core/modules/migrate_drupal_ui/src/Form/CredentialForm.php
Gets and stores information for this migration in temporary store.

File

core/modules/migrate_drupal/src/MigrationConfigurationTrait.php, line 69

Class

MigrationConfigurationTrait
Configures the appropriate migrations for a given source Drupal database.

Namespace

Drupal\migrate_drupal

Code

protected function getSystemData(Connection $connection) {
  $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 (DatabaseExceptionWrapper $e) {

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