class dibi

Static container class for Dibi connections.

Traits

Better OOP experience.

Constants

AFFECTED_ROWS

IDENTIFIER

VERSION

version

ASC

sorting order

DESC

sorting order

Properties

static string|null $sql
static float|null $elapsedTime
static float $totalTime
static int $numOfQueries

Methods

__construct()

Static class - cannot be instantiated.

static Connection
connect($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 $name = null)

Retrieve active connection.

static Connection
setConnection(Connection $connection)

Sets connection.

static 
__callStatic(string $name, array $args)

Monostate for Dibi\Connection.

static int
affectedRows() deprecated

No description

static int
insertId(string $sequence = null) deprecated

No description

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

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

stripMicroseconds(DateTimeInterface $dt)

Strips microseconds part.

Details

at line 76
final __construct()

Static class - cannot be instantiated.

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

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

Parameters

$config
string $name

Return Value

Connection

Exceptions

Exception

at line 99
static bool isConnected()

Returns true when connection was established.

Return Value

bool

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

Retrieve active connection.

Parameters

string $name

Return Value

Connection

Exceptions

Exception

at line 130
static Connection setConnection(Connection $connection)

Sets connection.

Parameters

Connection $connection

Return Value

Connection

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

Monostate for Dibi\Connection.

Parameters

string $name
array $args

at line 151
static int affectedRows() deprecated

deprecated

Return Value

int

at line 161
static int insertId(string $sequence = null) deprecated

deprecated

Parameters

string $sequence

Return Value

int

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

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

Parameters

string|Result $sql
bool $return return output instead of printing it?

Return Value

string|null

at line 185
static DateTimeInterface stripMicroseconds(DateTimeInterface $dt)

Strips microseconds part.

Parameters

DateTimeInterface $dt

Return Value

DateTimeInterface