class Context

Database context.

Methods

__construct(Connection $connection, IStructure $structure, IConventions $conventions = null, IStorage $cacheStorage = null)

No description

void
beginTransaction()

No description

void
commit()

No description

void
rollBack()

No description

string
getInsertId($name = null)

No description

query($sql, ...$params)

Generates and executes SQL query.

queryArgs($sql, array $params)

No description

table($table)

No description

getConnection()

No description

getStructure()

No description

getConventions()

No description

Row
fetch($sql, ...$params)

Shortcut for query()->fetch()

mixed
fetchField($sql, ...$params)

Shortcut for query()->fetchField()

array|null
fetchFields($sql, ...$params)

Shortcut for query()->fetchFields()

array
fetchPairs($sql, ...$params)

Shortcut for query()->fetchPairs()

array
fetchAll($sql, ...$params)

Shortcut for query()->fetchAll()

static SqlLiteral
literal($value, ...$params)

No description

Details

at line 34
__construct(Connection $connection, IStructure $structure, IConventions $conventions = null, IStorage $cacheStorage = null)

No description

Parameters

Connection $connection
IStructure $structure
IConventions $conventions
IStorage $cacheStorage

at line 44
void beginTransaction()

No description

Return Value

void

at line 51
void commit()

No description

Return Value

void

at line 58
void rollBack()

No description

Return Value

void

at line 68
string getInsertId($name = null)

No description

Parameters

$name

Return Value

string

at line 79
ResultSet query($sql, ...$params)

Generates and executes SQL query.

Parameters

$sql
...$params

Return Value

ResultSet

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

No description

Parameters

$sql
array $params

Return Value

ResultSet

at line 99
Selection table($table)

No description

Parameters

$table

Return Value

Selection

at line 106
Connection getConnection()

No description

Return Value

Connection

at line 113
IStructure getStructure()

No description

Return Value

IStructure

at line 120
IConventions getConventions()

No description

Return Value

IConventions

at line 134
Row fetch($sql, ...$params)

Shortcut for query()->fetch()

Parameters

$sql
...$params

Return Value

Row

at line 145
mixed fetchField($sql, ...$params)

Shortcut for query()->fetchField()

Parameters

$sql
...$params

Return Value

mixed

at line 156
array|null fetchFields($sql, ...$params)

Shortcut for query()->fetchFields()

Parameters

$sql
...$params

Return Value

array|null

at line 167
array fetchPairs($sql, ...$params)

Shortcut for query()->fetchPairs()

Parameters

$sql
...$params

Return Value

array

at line 178
array fetchAll($sql, ...$params)

Shortcut for query()->fetchAll()

Parameters

$sql
...$params

Return Value

array

at line 187
static SqlLiteral literal($value, ...$params)

No description

Parameters

$value
...$params

Return Value

SqlLiteral

Traits

SmartObject