class Explorer

Provides high-level database layer with ActiveRow pattern.

Methods

__construct(Connection $connection, IStructure $structure, Conventions|null $conventions = null, Storage|null $cacheStorage = null)

No description

void
beginTransaction()

No description

void
commit()

No description

void
rollBack()

No description

mixed
transaction(callable $callback)

Executes callback inside a transaction.

string
getInsertId(string|null $sequence = null)

No description

query(string $sql, mixed ...$params)

Generates and executes SQL query.

queryArgs(string $sql, array $params) deprecated

No description

table(string $table)

Returns table selection.

getConnection()

No description

getStructure()

No description

getConventions()

No description

createActiveRow(array $data, Selection $selection)

Creates an ActiveRow instance, using the configured row mapping class if available.

createGroupedSelection(Selection $refSelection, string $table, string $column)

No description

Row|null
fetch(string $sql, mixed ...$params)

Executes SQL query and returns the first row, or null if no rows were returned.

array|null
fetchAssoc(string $sql, mixed ...$params)

Executes SQL query and returns the first row as an associative array, or null.

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

Executes SQL query and returns the first field of the first row, or null.

array|null
fetchList(string $sql, mixed ...$params)

Executes SQL query and returns the first row as an indexed array, or null.

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

Executes SQL query and returns the first row as an indexed array, or null.

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

No description

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

Executes SQL query and returns all rows as an array of Row objects.

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

Creates SQL literal value.

Details

at line 24
__construct(Connection $connection, IStructure $structure, Conventions|null $conventions = null, Storage|null $cacheStorage = null)

No description

Parameters

Connection $connection
IStructure $structure
Conventions|null $conventions
Storage|null $cacheStorage

at line 34
void beginTransaction()

No description

Return Value

void

at line 40
void commit()

No description

Return Value

void

at line 46
void rollBack()

No description

Return Value

void

at line 56
mixed transaction(callable $callback)

Executes callback inside a transaction.

Parameters

callable $callback

Return Value

mixed

at line 62
string getInsertId(string|null $sequence = null)

No description

Parameters

string|null $sequence

Return Value

string

at line 72
ResultSet query(string $sql, mixed ...$params)

Generates and executes SQL query.

Parameters

string $sql
mixed ...$params

Return Value

ResultSet

at line 83
ResultSet queryArgs(string $sql, array $params) deprecated

deprecated use query()

No description

Parameters

string $sql
array $params

Return Value

ResultSet

at line 93
Selection table(string $table)

Returns table selection.

Parameters

string $table

Return Value

Selection

at line 99
Connection getConnection()

No description

Return Value

Connection

at line 105
IStructure getStructure()

No description

Return Value

IStructure

at line 111
Conventions getConventions()

No description

Return Value

Conventions

at line 122
ActiveRow createActiveRow(array $data, Selection $selection)

Creates an ActiveRow instance, using the configured row mapping class if available.

Parameters

array $data
Selection $selection

Return Value

ActiveRow

at line 133
GroupedSelection createGroupedSelection(Selection $refSelection, string $table, string $column)

internal  
 

No description

Parameters

Selection $refSelection
string $table
string $column

Return Value

GroupedSelection

at line 150
Row|null fetch(string $sql, mixed ...$params)

Executes SQL query and returns the first row, or null if no rows were returned.

Parameters

string $sql
mixed ...$params

Return Value

Row|null

at line 161
array|null fetchAssoc(string $sql, mixed ...$params)

Executes SQL query and returns the first row as an associative array, or null.

Parameters

string $sql
mixed ...$params

Return Value

array|null

at line 171
mixed fetchField(string $sql, mixed ...$params)

Executes SQL query and returns the first field of the first row, or null.

Parameters

string $sql
mixed ...$params

Return Value

mixed

at line 182
array|null fetchList(string $sql, mixed ...$params)

Executes SQL query and returns the first row as an indexed array, or null.

Parameters

string $sql
mixed ...$params

Return Value

array|null

at line 193
array|null fetchFields(string $sql, mixed ...$params)

Executes SQL query and returns the first row as an indexed array, or null.

Parameters

string $sql
mixed ...$params

Return Value

array|null

at line 204
array fetchPairs(string $sql, mixed ...$params)

No description

Parameters

string $sql
mixed ...$params

Return Value

array

at line 215
array fetchAll(string $sql, mixed ...$params)

Executes SQL query and returns all rows as an array of Row objects.

Parameters

string $sql
mixed ...$params

Return Value

array

at line 224
static SqlLiteral literal(string $value, mixed ...$params)

Creates SQL literal value.

Parameters

string $value
mixed ...$params

Return Value

SqlLiteral