class Connection implements Connection

Properties

$resultClass
$metaTypeKey

Methods

__construct(PDO $pdo)

No description

query(string $sql, array $params = [])

Executes an SQL query with optional parameters and returns a result set.

int
execute(string $sql)

Executes an SQL command and returns the number of affected rows.

void
beginTransaction()

Starts a new database transaction.

void
commit()

Commits the current database transaction.

void
rollBack()

Rolls back the current database transaction.

int|string
getInsertId(string|null $sequence = null)

Returns the ID of the last inserted row or sequence value.

string
quote(string $string)

Quotes a string for use in an SQL statement.

string
getServerVersion()

Returns the version of the database server.

mixed
getNativeConnection()

Returns the underlying database connection object.

Details

at line 25
__construct(PDO $pdo)

No description

Parameters

PDO $pdo

at line 31
Result query(string $sql, array $params = [])

Executes an SQL query with optional parameters and returns a result set.

Parameters

string $sql
array $params

Return Value

Result

at line 49
int execute(string $sql)

Executes an SQL command and returns the number of affected rows.

Parameters

string $sql

Return Value

int

at line 59
void beginTransaction()

Starts a new database transaction.

Return Value

void

at line 69
void commit()

Commits the current database transaction.

Return Value

void

at line 79
void rollBack()

Rolls back the current database transaction.

Return Value

void

at line 89
int|string getInsertId(string|null $sequence = null)

Returns the ID of the last inserted row or sequence value.

Parameters

string|null $sequence

Return Value

int|string

at line 105
string quote(string $string)

Quotes a string for use in an SQL statement.

Parameters

string $string

Return Value

string

at line 111
string getServerVersion()

Returns the version of the database server.

Return Value

string

at line 117
mixed getNativeConnection()

Returns the underlying database connection object.

Return Value

mixed