class dibi

Static container class for Dibi connections.

Constants

AFFECTED_ROWS

IDENTIFIER

VERSION

version

ASC

sorting order

DESC

sorting order

Properties

static $sql

Last SQL command dibi::query()

static $elapsedTime

Elapsed time for last query

static $totalTime

Elapsed time for all queries

static $numOfQueries

Number or queries

Methods

__construct()

Static class - cannot be instantiated.

static Connection
connect(array $config = [], string $name = '0')

Creates a new Connection object and connects it to specified database.

static bool
isConnected()

Returns true when connection was established.

static Connection
getConnection(string|null $name = null)

Retrieve active connection.

static Connection
setConnection(Connection $connection)

Sets connection.

static 
__callStatic(string $name, array $args)

Monostate for Dibi\Connection.

static string|null
dump(Result|null $sql = null, bool $return = false)

Prints out a syntax highlighted version of the SQL command or Result.

stripMicroseconds(DateTimeInterface $dt)

Strips microseconds part.

static void
disconnect()

No description

static Result
query(mixed $args)

No description

static Result
nativeQuery(mixed $args)

No description

static bool
test(mixed $args)

No description

static DataSource
dataSource(mixed $args)

No description

static Row|null
fetch(mixed $args)

No description

static array
fetchAll(mixed $args)

No description

static mixed
fetchSingle(mixed $args)

No description

static array
fetchPairs(mixed $args)

No description

static int
getAffectedRows()

No description

static int
getInsertId(string $sequence = null)

No description

static void
begin(string $savepoint = null)

No description

static void
commit(string $savepoint = null)

No description

static void
rollback(string $savepoint = null)

No description

static mixed
transaction(callable $callback)

No description

static Database
getDatabaseInfo()

No description

static Fluent
command()

No description

static Fluent
select(mixed $args)

No description

static Fluent
update(string|string[] $table, array $args)

No description

static Fluent
insert(string $table, array $args)

No description

static Fluent
delete(string $table)

No description

static HashMap
getSubstitutes()

No description

static int
loadFile(string $file)

No description

Details

at line 74
final __construct()

Static class - cannot be instantiated.

at line 88
static Connection connect(array $config = [], string $name = '0')

Creates a new Connection object and connects it to specified database.

Parameters

array $config

connection parameters

string $name

Return Value

Connection

Exceptions

Exception

at line 97
static bool isConnected()

Returns true when connection was established.

Return Value

bool

at line 107
static Connection getConnection(string|null $name = null)

Retrieve active connection.

Parameters

string|null $name

Return Value

Connection

Exceptions

Exception

at line 128
static Connection setConnection(Connection $connection)

Sets connection.

Parameters

Connection $connection

Return Value

Connection

at line 140
static __callStatic(string $name, array $args)

Monostate for Dibi\Connection.

Parameters

string $name
array $args

at line 153
static string|null dump(Result|null $sql = null, bool $return = false)

Prints out a syntax highlighted version of the SQL command or Result.

Parameters

Result|null $sql
bool $return

return output instead of printing it?

Return Value

string|null

at line 162
static DateTimeInterface stripMicroseconds(DateTimeInterface $dt)

Strips microseconds part.

Parameters

DateTimeInterface $dt

Return Value

DateTimeInterface

at line 38
static void disconnect()

No description

Return Value

void

at line 38
static Result query(mixed $args)

No description

Parameters

mixed $args

Return Value

Result

at line 38
static Result nativeQuery(mixed $args)

No description

Parameters

mixed $args

Return Value

Result

at line 38
static bool test(mixed $args)

No description

Parameters

mixed $args

Return Value

bool

at line 38
static DataSource dataSource(mixed $args)

No description

Parameters

mixed $args

Return Value

DataSource

at line 38
static Row|null fetch(mixed $args)

No description

Parameters

mixed $args

Return Value

Row|null

at line 38
static array fetchAll(mixed $args)

No description

Parameters

mixed $args

Return Value

array

at line 38
static mixed fetchSingle(mixed $args)

No description

Parameters

mixed $args

Return Value

mixed

at line 38
static array fetchPairs(mixed $args)

No description

Parameters

mixed $args

Return Value

array

at line 38
static int getAffectedRows()

No description

Return Value

int

at line 38
static int getInsertId(string $sequence = null)

No description

Parameters

string $sequence

Return Value

int

at line 38
static void begin(string $savepoint = null)

No description

Parameters

string $savepoint

Return Value

void

at line 38
static void commit(string $savepoint = null)

No description

Parameters

string $savepoint

Return Value

void

at line 38
static void rollback(string $savepoint = null)

No description

Parameters

string $savepoint

Return Value

void

at line 38
static mixed transaction(callable $callback)

No description

Parameters

callable $callback

Return Value

mixed

at line 38
static Database getDatabaseInfo()

No description

Return Value

Database

at line 38
static Fluent command()

No description

Return Value

Fluent

at line 38
static Fluent select(mixed $args)

No description

Parameters

mixed $args

Return Value

Fluent

at line 38
static Fluent update(string|string[] $table, array $args)

No description

Parameters

string|string[] $table
array $args

Return Value

Fluent

at line 38
static Fluent insert(string $table, array $args)

No description

Parameters

string $table
array $args

Return Value

Fluent

at line 38
static Fluent delete(string $table)

No description

Parameters

string $table

Return Value

Fluent

at line 38
static HashMap getSubstitutes()

No description

Return Value

HashMap

at line 38
static int loadFile(string $file)

No description

Parameters

string $file

Return Value

int