final class Xeed implements ArrayAccess (View source)

Database Object.

Constants

AVAILABLE_DATABASES

Array of available databases.

LARAVEL_DEFAULT_TABLES

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

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.

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.

static Xeed getInstance()

Singleton factory method.

Return Value

Xeed

The method returns the singleton instance

__wakeup()

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

static Xeed make()

Singleton factory method without connection.

Return Value

Xeed

The method returns the singleton instance without connection

static Xeed getNewInstance()

Get new instance

Return Value

Xeed

The method returns new singleton instance

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

array getTables()

Get attached tables.

Return Value

array

The method returns the attached tables

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

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

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

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

void offsetUnset(mixed $offset)

Implements ArrayAccess interface.

Parameters

mixed $offset

Return Value

void

array toArray()

Get a tables array.

Return Value

array

The method returns the array of tables