# Documentation

Menu

## Driver extends AbstractDriver
in package

Driver.php : 27

MySQL specific class

### Table of Contents

__call() : mixed
  Allow invoke to work on table object
__construct() : mixed
  Connect to MySQL Database
_quote() : mixed
  Helper method for quote_ident
affectedRows() : int
  Returns number of rows affected by an INSERT, UPDATE, DELETE type query
driverQuery() : array<string|int, mixed>|null
  Method to simplify retrieving db results for meta-data queries
getColumns() : array<string|int, mixed>|null
  Retrieve column information for the current database table
getDbs() : array<string|int, mixed>|null
  Return list of dbs for the current connection, if possible
getFks() : array<string|int, mixed>|null
  Retrieve foreign keys for the table
getFunctions() : array<string|int, mixed>|null
  Return list of functions for the current database
getIndexes() : array<string|int, mixed>|null
  Retrieve indexes for the table
getLastQuery() : string
  Get the last sql query executed
getProcedures() : array<string|int, mixed>|null
  Return list of stored procedures for the current database
getSchemas() : array<string|int, mixed>|null
  Return schemas for databases that list them
getSequences() : array<string|int, mixed>|null
  Return list of sequences for the current database, if they exist
getSql() : SQLInterface
  Get the SQL class for the current driver
getSystemTables() : array<string|int, mixed>|null
  Retrieves an array of non-user-created tables for the connection/database
getTables() : array<string|int, mixed>|null
  Return list of tables for the current database
getTriggers() : array<string|int, mixed>|null
  Return list of triggers for the current database
getTypes() : array<string|int, mixed>|null
  Retrieve list of data types for the database
getUtil() : AbstractUtil
  Get the Util class for the current driver
getVersion() : string
  Get the version of the database engine
getViews() : array<string|int, mixed>|null
  Return list of views for the current database
insertBatch() : array<string|int, mixed>
  Create sql for batch insert
numRows() : int|null
  Return the number of rows returned for a SELECT query
prefixTable() : string
  Prefixes a table if it is not already prefixed
prepareExecute() : PDOStatement
  Create and execute a prepared statement with the provided parameters
prepareQuery() : PDOStatement
  Simplifies prepared statements for database queries
quoteIdent() : string|array<string|int, mixed>
  Surrounds the string with the databases identifier escape characters
quoteTable() : string
  Quote database table name, and set prefix
returning() : string
  Generate the returning clause for the current database
setLastQuery() : void
  Set the last query sql
setTablePrefix() : void
  Set the common table name prefix
truncate() : PDOStatement
  Empty the passed table
updateBatch() : array<string|int, mixed>
  Creates a batch update, and executes it.

### Methods

#### __call()

AbstractDriver.php : 93

Allow invoke to work on table object

`public __call(string $name[, array<string|int, mixed> $args = [] ]) : mixed`

##### Parameters

$name : string
$args : array<string|int, mixed> = []

##### Return values

mixed —

#### __construct()

Driver.php : 42

Connect to MySQL Database

`public __construct(string $dsn[, string|null $username = NULL ][, string|null $password = NULL ][, array<string|int, mixed> $options = [] ]) : mixed`

##### Parameters

$dsn : string
$username : string|null = NULL
$password : string|null = NULL
$options : array<string|int, mixed> = []

##### Return values

mixed —

#### _quote()

AbstractDriver.php : 603

Helper method for quote_ident

`public _quote(mixed $str) : mixed`

##### Parameters

$str : mixed

##### Return values

mixed —

#### affectedRows()

AbstractDriver.php : 209

Returns number of rows affected by an INSERT, UPDATE, DELETE type query

`public affectedRows() : int`

##### Return values

int —

#### driverQuery()

AbstractDriver.php : 424

Method to simplify retrieving db results for meta-data queries

`public driverQuery(string|array<string|int, mixed> $query[, bool $filteredIndex = TRUE ]) : array<string|int, mixed>|null`

##### Parameters

$query : string|array<string|int, mixed>
$filteredIndex : bool = TRUE

##### Return values

array<string|int, mixed>|null —

#### getColumns()

AbstractDriver.php : 384

Retrieve column information for the current database table

`public getColumns(string $table) : array<string|int, mixed>|null`

##### Parameters

$table : string

##### Return values

array<string|int, mixed>|null —

#### getDbs()

AbstractDriver.php : 318

Return list of dbs for the current connection, if possible

`public getDbs() : array<string|int, mixed>|null`

##### Return values

array<string|int, mixed>|null —

#### getFks()

AbstractDriver.php : 392

Retrieve foreign keys for the table

`public getFks(string $table) : array<string|int, mixed>|null`

##### Parameters

$table : string

##### Return values

array<string|int, mixed>|null —

#### getFunctions()

AbstractDriver.php : 347

Return list of functions for the current database

`public getFunctions() : array<string|int, mixed>|null`

##### Tags

deprecated

  Will be removed in next version

##### Return values

array<string|int, mixed>|null —

#### getIndexes()

AbstractDriver.php : 400

Retrieve indexes for the table

`public getIndexes(string $table) : array<string|int, mixed>|null`

##### Parameters

$table : string

##### Return values

array<string|int, mixed>|null —

#### getLastQuery()

AbstractDriver.php : 130

Get the last sql query executed

`public getLastQuery() : string`

##### Return values

string —

#### getProcedures()

AbstractDriver.php : 357

Return list of stored procedures for the current database

`public getProcedures() : array<string|int, mixed>|null`

##### Tags

deprecated

  Will be removed in next version

##### Return values

array<string|int, mixed>|null —

#### getSchemas()

AbstractDriver.php : 298

Return schemas for databases that list them

`public getSchemas() : array<string|int, mixed>|null`

##### Return values

array<string|int, mixed>|null —

#### getSequences()

AbstractDriver.php : 337

Return list of sequences for the current database, if they exist

`public getSequences() : array<string|int, mixed>|null`

##### Return values

array<string|int, mixed>|null —

#### getSql()

AbstractDriver.php : 146

Get the SQL class for the current driver

`public getSql() : SQLInterface`

##### Return values

SQLInterface —

#### getSystemTables()

AbstractDriver.php : 376

Retrieves an array of non-user-created tables for the connection/database

`public getSystemTables() : array<string|int, mixed>|null`

##### Return values

array<string|int, mixed>|null —

#### getTables()

AbstractDriver.php : 307

Return list of tables for the current database

`public getTables() : array<string|int, mixed>|null`

##### Return values

array<string|int, mixed>|null —

#### getTriggers()

AbstractDriver.php : 367

Return list of triggers for the current database

`public getTriggers() : array<string|int, mixed>|null`

##### Tags

deprecated

  Will be removed in next version

##### Return values

array<string|int, mixed>|null —

#### getTypes()

AbstractDriver.php : 408

Retrieve list of data types for the database

`public getTypes() : array<string|int, mixed>|null`

##### Return values

array<string|int, mixed>|null —

#### getUtil()

AbstractDriver.php : 154

Get the Util class for the current driver

`public getUtil() : AbstractUtil`

##### Return values

AbstractUtil —

#### getVersion()

AbstractDriver.php : 416

Get the version of the database engine

`public getVersion() : string`

##### Return values

string —

#### getViews()

AbstractDriver.php : 326

Return list of views for the current database

`public getViews() : array<string|int, mixed>|null`

##### Return values

array<string|int, mixed>|null —

#### insertBatch()

AbstractDriver.php : 471

Create sql for batch insert

`public insertBatch(string $table[, array<string|int, mixed> $data = [] ]) : array<string|int, mixed>`

##### Parameters

$table : string
$data : array<string|int, mixed> = []

##### Return values

array<string|int, mixed> —

#### numRows()

AbstractDriver.php : 453

Return the number of rows returned for a SELECT query

`public numRows() : int|null`

##### Tags

see
  http://us3.php.net/manual/en/pdostatement.rowcount.php#87110

##### Return values

int|null —

#### prefixTable()

AbstractDriver.php : 218

Prefixes a table if it is not already prefixed

`public prefixTable(string $table) : string`

##### Parameters

$table : string

##### Return values

string —

#### prepareExecute()

AbstractDriver.php : 198

Create and execute a prepared statement with the provided parameters

`public prepareExecute(string $sql, array<string|int, mixed> $params) : PDOStatement`

##### Parameters

$sql : string
$params : array<string|int, mixed>

##### Tags

throws
  InvalidArgumentException

##### Return values

PDOStatement —

#### prepareQuery()

AbstractDriver.php : 173

Simplifies prepared statements for database queries

`public prepareQuery(string $sql, array<string|int, mixed> $data) : PDOStatement`

##### Parameters

$sql : string
$data : array<string|int, mixed>

##### Return values

PDOStatement —

#### quoteIdent()

AbstractDriver.php : 256

Surrounds the string with the databases identifier escape characters

`public quoteIdent(string|array<string|int, mixed> $identifier) : string|array<string|int, mixed>`

##### Parameters

$identifier : string|array<string|int, mixed>

##### Return values

string|array<string|int, mixed> —

#### quoteTable()

AbstractDriver.php : 245

Quote database table name, and set prefix

`public quoteTable(string $table) : string`

##### Parameters

$table : string

##### Return values

string —

#### returning()

Driver.php : 64

Generate the returning clause for the current database

`public returning(string $query, string $select) : string`

##### Parameters

$query : string
$select : string

##### Return values

string —

#### setLastQuery()

AbstractDriver.php : 138

Set the last query sql

`public setLastQuery(string $queryString) : void`

##### Parameters

$queryString : string

##### Return values

void —

#### setTablePrefix()

AbstractDriver.php : 162

Set the common table name prefix

`public setTablePrefix(string $prefix) : void`

##### Parameters

$prefix : string

##### Return values

void —

#### truncate()

AbstractDriver.php : 579

Empty the passed table

`public truncate(string $table) : PDOStatement`

##### Parameters

$table : string

##### Return values

PDOStatement —

#### updateBatch()

AbstractDriver.php : 510

Creates a batch update, and executes it.

`public updateBatch(string $table, array<string|int, mixed> $data, string $where) : array<string|int, mixed>`

Returns the number of affected rows

##### Parameters

$table : string

  The table to update

$data : array<string|int, mixed>

  an array of update values

$where : string

  The where key

##### Return values

array<string|int, mixed> —

## Search results