Documentation

Driver

Driver interface.

Interface that all DBAL drivers must implement.

Tags
since
2.0

Table of Contents

connect()  : Connection
Attempts to create a connection with the database.
getDatabase()  : string
Gets the name of the database connected to for this driver.
getDatabasePlatform()  : AbstractPlatform
Gets the DatabasePlatform instance that provides all the metadata about the platform this driver connects to.
getName()  : string
Gets the name of the driver.
getSchemaManager()  : AbstractSchemaManager
Gets the SchemaManager that can be used to inspect and change the underlying database schema of the platform this driver connects to.

Methods

connect()

Attempts to create a connection with the database.

public connect(array<string|int, mixed> $params[, string|null $username = null ][, string|null $password = null ][, array<string|int, mixed> $driverOptions = array() ]) : Connection
Parameters
$params : array<string|int, mixed>

All connection parameters passed by the user.

$username : string|null = null

The username to use when connecting.

$password : string|null = null

The password to use when connecting.

$driverOptions : array<string|int, mixed> = array()

The driver options to use when connecting.

Return values
Connection

The database connection.

getDatabase()

Gets the name of the database connected to for this driver.

public getDatabase(Connection $conn) : string
Parameters
$conn : Connection
Return values
string

The name of the database.

getDatabasePlatform()

Gets the DatabasePlatform instance that provides all the metadata about the platform this driver connects to.

public getDatabasePlatform() : AbstractPlatform
Return values
AbstractPlatform

The database platform.

getName()

Gets the name of the driver.

public getName() : string
Return values
string

The name of the driver.

Search results