You are here

protected function MigrationCreationTrait::getConnection in Migrate Upgrade 8

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.

2 calls to MigrationCreationTrait::getConnection()
MigrationCreationTrait::getMigrationTemplates in src/MigrationCreationTrait.php
Sets up the relevant migrations for import from a database connection.
MigrationCreationTrait::getSystemData in src/MigrationCreationTrait.php
Gets the system data from the system table of the source Drupal database.

File

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

Class

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

Namespace

Drupal\migrate_upgrade

Code

protected function getConnection(array $database) {

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