Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MigrationConfigurationTrait.php

function MigrationConfigurationTrait::getConnection

Gets the database connection for the source Drupal database.

Parameters

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

Return value

\Drupal\Core\Database\Connection The database connection for the source Drupal database.

1 call to MigrationConfigurationTrait::getConnection()
CredentialForm::validateForm in core/modules/migrate_drupal_ui/src/Form/CredentialForm.php
Form validation handler.

File

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

Class

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

Namespace

Drupal\migrate_drupal

Code

protected function getConnection(array $database) {
    // Set up the connection.
    Database::addConnectionInfo('upgrade', 'default', $database);
    $connection = Database::getConnection('default', 'upgrade');
    return $connection;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal