final class Xeed implements ArrayAccess

Database Object.

Constants

AVAILABLE_DATABASES

Array of available databases.

Properties

$pdo

PDO Instance.

$driver

Driver name. eg. 'mysql' or 'sqlite'

Methods

addConnection(array $connection)

Establish connection

addPdo(PDO $pdo)

Add PDO connection.

static Xeed
getInstance()

Singleton factory method.

__wakeup()

prevent from being unserialized (which would create a second instance of it)

static Xeed
make()

Singleton factory method without connection.

static Xeed
getNewInstance()

Get new instance

attach(string|null $table = null)

Attach tables and columns.

array
getTables()

Get attached tables.

Table|null
getTable(string $table)

Get a specific attached table.

bool
offsetExists(mixed $offset)

Implements ArrayAccess interface.

mixed
offsetGet(mixed $offset)

Implements ArrayAccess interface.

void
offsetSet(mixed $offset, mixed $value)

Implements ArrayAccess interface.

void
offsetUnset(mixed $offset)

Implements ArrayAccess interface.

array
toArray()

Get a tables array.

Details

at line 58
Xeed addConnection(array $connection)

Establish connection

Parameters

array $connection

The elements of the connection array.($driver, $database, $host, $port, $username, $password)

Return Value

Xeed

The method returns the current instance that enables method chaining.

at line 102
Xeed addPdo(PDO $pdo)

Add PDO connection.

Parameters

PDO $pdo

Return Value

Xeed

The method get PDO instance and returns the current instance that enables method chaining.

at line 118
static Xeed getInstance()

Singleton factory method.

Return Value

Xeed

The method returns the singleton instance

at line 154
__wakeup()

prevent from being unserialized (which would create a second instance of it)

at line 164
static Xeed make()

Singleton factory method without connection.

Return Value

Xeed

The method returns the singleton instance without connection

at line 178
static Xeed getNewInstance()

Get new instance

Return Value

Xeed

The method returns new singleton instance

at line 191
Xeed attach(string|null $table = null)

Attach tables and columns.

Parameters

string|null $table

The table name to attach child provider

Return Value

Xeed

The method returns the instance for chaining

at line 203
array getTables()

Get attached tables.

Return Value

array

The method returns the attached tables

at line 213
Table|null getTable(string $table)

Get a specific attached table.

Parameters

string $table

Return Value

Table|null

The method returns the table instance or null

at line 228
bool offsetExists(mixed $offset)

Implements ArrayAccess interface.

Parameters

mixed $offset

The offset to retrieve

Return Value

bool

The method returns whether the offset exists or not

at line 239
mixed offsetGet(mixed $offset)

Implements ArrayAccess interface.

Parameters

mixed $offset

The offset to retrieve

Return Value

mixed

The method returns the table instance or null by offset

at line 250
void offsetSet(mixed $offset, mixed $value)

Implements ArrayAccess interface.

Parameters

mixed $offset

The offset to retrieve

mixed $value

The value to set

Return Value

void

at line 262
void offsetUnset(mixed $offset)

Implements ArrayAccess interface.

Parameters

mixed $offset

Return Value

void

at line 272
array toArray()

Get a tables array.

Return Value

array

The method returns the array of tables