Database::getConnection
final public static function Database::getConnection
final public static Database::getConnection($target = 'default', $key = NULL)
Gets the connection object for the specified database key and target.
Parameters
string $target: The database target name.
string $key: The database connection key. Defaults to NULL which means the active key.
Return value
\Drupal\Core\Database\Connection The corresponding connection object.
File
- core/lib/Drupal/Core/Database/登录查看完整内容