function MigrationConfigurationTrait::getSystemData

Same name in other branches
  1. 8.9.x core/modules/migrate_drupal/src/MigrationConfigurationTrait.php \Drupal\migrate_drupal\MigrationConfigurationTrait::getSystemData()
  2. 10 core/modules/migrate_drupal/src/MigrationConfigurationTrait.php \Drupal\migrate_drupal\MigrationConfigurationTrait::getSystemData()
  3. 11.x 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;
}

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