class Explorer

The central access point to Nette Database functionality.

Constants

private Drivers

private TypeConverterOptions

Properties

$onConnect
$onQuery

Methods

static Explorer
createFromParameters(...$params)

No description

static Explorer
createFromDsn(string $dsn, string|null $username = null, string|null $password = null, array $options = [])

No description

__construct(Driver|string $driver)

No description

void
connect()

No description

void
reconnect()

No description

void
disconnect()

No description

string
getDsn()

No description

PDO
getPdo()

No description

getConnection()

No description

getDatabaseEngine()

No description

string
getServerVersion()

No description

getReflection()

No description

getTypeConverter()

No description

setRowNormalizer(callable|null $normalizer)

No description

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

No description

string
quote(string $string)

No description

void
beginTransaction()

No description

void
commit()

No description

void
rollBack()

No description

mixed
transaction(callable $callback)

No description

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

Generates and executes SQL query.

queryArgs(string $sql, array $params)

No description

array
preprocess(string $sql, ...$params)

No description

SqlLiteral|null
getLastQuery()

No description

string|null
getLastQueryString()

No description

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

Shortcut for query()->fetch()

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

Shortcut for query()->fetchAssoc()

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

Shortcut for query()->fetchField()

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

Shortcut for query()->fetchList()

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

Shortcut for query()->fetchList()

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

Shortcut for query()->fetchPairs()

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

Shortcut for query()->fetchAll()

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

No description

table(string $table)

No description

setCache(Cache $cache)

No description

Cache|null
getCache()

No description

setConventions(Conventions $conventions)

No description

getConventions()

No description

getStructure()

No description

Details

at line 51
static Explorer createFromParameters(...$params)

No description

Parameters

...$params

Return Value

Explorer

at line 83
static Explorer createFromDsn(string $dsn, string|null $username = null, string|null $password = null, array $options = [])

No description

Parameters

string $dsn
string|null $username
string|null $password
array $options

Return Value

Explorer

at line 103
__construct(Driver|string $driver)

No description

Parameters

Driver|string $driver

at line 116
void connect()

No description

Return Value

void

at line 132
void reconnect()

No description

Return Value

void

at line 139
void disconnect()

No description

Return Value

void

at line 145
string getDsn()

No description

Return Value

string

at line 152
PDO getPdo()

No description

Return Value

PDO

at line 160
Connection getConnection()

No description

Return Value

Connection

at line 167
Connection getSupplementalDriver()

No description

Return Value

Connection

at line 175
Engine getDatabaseEngine()

No description

Return Value

Engine

at line 181
string getServerVersion()

No description

Return Value

string

at line 187
Reflection getReflection()

No description

Return Value

Reflection

at line 193
TypeConverter getTypeConverter()

No description

Return Value

TypeConverter

at line 199
Explorer setRowNormalizer(callable|null $normalizer)

No description

Parameters

callable|null $normalizer

Return Value

Explorer

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

No description

Parameters

string|null $sequence

Return Value

int|string

at line 216
string quote(string $string)

No description

Parameters

string $string

Return Value

string

at line 222
void beginTransaction()

No description

Return Value

void

at line 232
void commit()

No description

Return Value

void

at line 242
void rollBack()

No description

Return Value

void

at line 252
mixed transaction(callable $callback)

No description

Parameters

callable $callback

Return Value

mixed

at line 283
Result query(string $sql, ...$params)

Generates and executes SQL query.

Parameters

string $sql
...$params

Return Value

Result

at line 293
Result queryArgs(string $sql, array $params)

No description

Parameters

string $sql
array $params

Return Value

Result

at line 305
array preprocess(string $sql, ...$params)

No description

Parameters

string $sql
...$params

Return Value

array

at line 333
SqlLiteral|null getLastQuery()

No description

Return Value

SqlLiteral|null

at line 339
string|null getLastQueryString()

No description

Return Value

string|null

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

Shortcut for query()->fetch()

Parameters

string $sql
...$params

Return Value

Row|null

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

Shortcut for query()->fetchAssoc()

Parameters

string $sql
...$params

Return Value

array|null

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

Shortcut for query()->fetchField()

Parameters

string $sql
...$params

Return Value

mixed

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

Shortcut for query()->fetchList()

Parameters

string $sql
...$params

Return Value

array|null

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

Shortcut for query()->fetchList()

Parameters

string $sql
...$params

Return Value

array|null

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

Shortcut for query()->fetchPairs()

Parameters

string $sql
...$params

Return Value

array

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

Shortcut for query()->fetchAll()

Parameters

string $sql
...$params

Return Value

array

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

No description

Parameters

string $value
...$params

Return Value

SqlLiteral

at line 436
Selection table(string $table)

No description

Parameters

string $table

Return Value

Selection

at line 442
Explorer setCache(Cache $cache)

No description

Parameters

Cache $cache

Return Value

Explorer

at line 453
Cache|null getCache()

internal  
 

No description

Return Value

Cache|null

at line 459
Explorer setConventions(Conventions $conventions)

No description

Parameters

Conventions $conventions

Return Value

Explorer

at line 470
Conventions getConventions()

internal  
 

No description

Return Value

Conventions

at line 477
Structure getStructure()

internal  
 

No description

Return Value

Structure