Menu

## DriverBase
in package

AbstractYes
DriverBase.php : 12

This is an abstract class that serves as the base for all database driver's classes.

It provides common functionality and properties that are shared among different database drivers.

### Table of Contents

#### Properties

$driver : string
$dsnParams : array<string, string>
$password : string
$pdo : PDO|null
$username : string

#### Methods

connect() : Mysql|Firebird|Oci|Pgsql
  Establishes a connection to the database using the provided DSN, username, and password.
disconnect() : void
  Disconnects from the database.
driverSupportsLastInsertId() : bool
  Determines if the driver supports the last insert ID feature.
getDeleteSql() : string
getDriver() : string
  Returns the driver name for the connection.
getDriverColumnName() : string
  Returns the name of the driver column.
getGetColumnsSql() : string
  Returns the SQL query to retrieve the columns of a table.
getGetTablesSql() : string
  Returns the SQL query to retrieve the list of tables in the database.
getLimitSql() : string
  Retrieves the SQL query for applying a limit to the result set based on the specific driver.
getPdo() : PDO
  Returns the PDO object representing the database connection.

### Properties

#### $driver

DriverBase.php : 16
`protected string $driver`

#### $dsnParams

DriverBase.php : 21
`protected array<string, string> $dsnParams = []`

The array to store the connection details.

#### $password

DriverBase.php : 25
`protected string $password`

#### $pdo

DriverBase.php : 14
`protected PDO|null $pdo = null`

#### $username

DriverBase.php : 23
`protected string $username`

### Methods

#### connect()

DriverBase.php : 35

Establishes a connection to the database using the provided DSN, username, and password.

`public abstract connect(array<string, string> $dsn, string $username, string $password) : Mysql|Firebird|Oci|Pgsql`

##### Parameters

$dsn : array<string, string>

  The data source name.

$username : string

  The username for the database connection.

$password : string

  The password for the database connection.

##### Return values

Mysql|Firebird|Oci|Pgsql —

The object representing the database driver.

#### disconnect()

DriverBase.php : 40

Disconnects from the database.

`public disconnect() : void`

#### driverSupportsLastInsertId()

DriverBase.php : 75

Determines if the driver supports the last insert ID feature.

`public abstract driverSupportsLastInsertId() : bool`

##### Return values

bool —

True if the driver supports last insert ID, false otherwise.

#### getDeleteSql()

DriverBase.php : 113
`public abstract getDeleteSql(string $table, string $where) : string`

##### Parameters

$table : string
$where : string

##### Return values

string

#### getDriver()

DriverBase.php : 50

Returns the driver name for the connection.

`public getDriver() : string`

##### Return values

string —

The driver name.

#### getDriverColumnName()

DriverBase.php : 95

Returns the name of the driver column.

`public abstract getDriverColumnName() : string`

##### Return values

string —

The name of the driver column.

#### getGetColumnsSql()

DriverBase.php : 88

Returns the SQL query to retrieve the columns of a table.

`public abstract getGetColumnsSql(string $table) : string`

##### Parameters

$table : string

  The name of the table.

##### Return values

string —

The SQL query to retrieve the columns of the table.

#### getGetTablesSql()

DriverBase.php : 102

Returns the SQL query to retrieve the list of tables in the database.

`public abstract getGetTablesSql() : string`

##### Return values

string —

The SQL query.

#### getLimitSql()

DriverBase.php : 110

Retrieves the SQL query for applying a limit to the result set based on the specific driver.

`public abstract getLimitSql(string $limit) : string`

##### Parameters

$limit : string

  The limit to be applied to the result set.

##### Return values

string —

The SQL query for applying the limit.

#### getPdo()

DriverBase.php : 60

Returns the PDO object representing the database connection.

`public getPdo() : PDO`

##### Return values

PDO —

The PDO object representing the database connection.

## Search results