/**
* Gets the database connection object.
*
* @return \Drupal\Core\Database\Connection
* The database connection.
*/
public function getDatabase() { if (!
isset($this->database
)) { // Look first for an explicit state key containing the configuration.
if (isset($this->configuration
['database_state_key'
])) { $this->database =
$this->
setUpDatabase($this->state->
get($this->configuration
['database_state_key'
]));
} // Next, use explicit configuration in the source plugin.
elseif (isset($this->configuration
['key'
])) { $this->database =
$this->
setUpDatabase($this->configuration
);
} // Next, try falling back to the global state key.
elseif (($fallback_state_key =
$this->state->
get('migrate.fallback_state_key'
))) { $this->database =
$this->
setUpDatabase($this->state->
get($fallback_state_key));
} // If all else fails, let setUpDatabase() fallback to the 'migrate' key.
else {