class Connection extends Object

Represents a connection between PHP and a database server.

Properties

callable[] $onConnect
callable[] $onQuery
ISupplementalDriver read-only $supplementalDriver
string read-only $dsn
PDO read-only $pdo

Methods

__construct($dsn, $user = NULL, $password = NULL, array $options = NULL)

No description

void
connect()

No description

void
reconnect()

No description

void
disconnect()

No description

string
getDsn()

No description

PDO
getPdo()

No description

string
getInsertId($name = NULL)

No description

string
quote($string, $type = PDO::PARAM_STR)

No description

void
beginTransaction()

No description

void
commit()

No description

void
rollBack()

No description

query($sql)

Generates and executes SQL query.

queryArgs($sql, array $params)

No description

preprocess($sql)

No description

Row
fetch($args)

Shortcut for query()->fetch()

mixed
fetchField($args)

Shortcut for query()->fetchField()

array
fetchPairs($args)

Shortcut for query()->fetchPairs()

array
fetchAll($args)

Shortcut for query()->fetchAll()

static SqlLiteral
literal($value)

No description

Details

at line 46
__construct($dsn, $user = NULL, $password = NULL, array $options = NULL)

No description

Parameters

$dsn
$user
$password
array $options

at line 61
void connect()

No description

Return Value

void

at line 84
void reconnect()

No description

Return Value

void

at line 92
void disconnect()

No description

Return Value

void

at line 99
string getDsn()

No description

Return Value

string

at line 106
PDO getPdo()

No description

Return Value

PDO

at line 114
ISupplementalDriver getSupplementalDriver()

No description

Return Value

ISupplementalDriver

at line 125
string getInsertId($name = NULL)

No description

Parameters

$name

Return Value

string

at line 140
string quote($string, $type = PDO::PARAM_STR)

No description

Parameters

$string
$type

Return Value

string

at line 151
void beginTransaction()

No description

Return Value

void

at line 158
void commit()

No description

Return Value

void

at line 165
void rollBack()

No description

Return Value

void

at line 177
ResultSet query($sql)

Generates and executes SQL query.

Parameters

$sql

Return Value

ResultSet

at line 201
ResultSet queryArgs($sql, array $params)

No description

Parameters

$sql
array $params

Return Value

ResultSet

at line 211
preprocess($sql)

No description

Parameters

$sql

at line 229
Row fetch($args)

Shortcut for query()->fetch()

Parameters

$args

Return Value

Row

at line 241
mixed fetchField($args)

Shortcut for query()->fetchField()

Parameters

$args

Return Value

mixed

at line 253
array fetchPairs($args)

Shortcut for query()->fetchPairs()

Parameters

$args

Return Value

array

at line 265
array fetchAll($args)

Shortcut for query()->fetchAll()

Parameters

$args

Return Value

array

at line 274
static SqlLiteral literal($value)

No description

Parameters

$value

Return Value

SqlLiteral