interface IStructure

Provides cached reflection for database structure.

Constants

FIELD_TEXT

FIELD_BINARY

FIELD_BOOL

FIELD_INTEGER

FIELD_FLOAT

FIELD_DECIMAL

FIELD_DATE

FIELD_TIME

FIELD_DATETIME

FIELD_UNIX_TIMESTAMP

FIELD_TIME_INTERVAL

Methods

array
getTables()

Returns all tables in the database.

array
getColumns(string $table)

Returns all columns in a table.

string|array|null
getPrimaryKey(string $table)

Returns table primary key.

string|null
getPrimaryAutoincrementKey(string $table)

Returns autoincrement primary key name.

string|null
getPrimaryKeySequence(string $table)

Returns table primary key sequence.

array|null
getHasManyReference(string $table)

Returns tables referencing the given table via foreign key, or null if unknown.

array|null
getBelongsToReference(string $table)

Returns foreign key columns in the given table mapped to their referenced tables, or null if unknown.

void
rebuild()

Rebuilds database structure cache.

bool
isRebuilt()

Checks whether the structure has been rebuilt from the database during this request.

Details

at line 33
array getTables()

Returns all tables in the database.

Return Value

array

at line 39
array getColumns(string $table)

Returns all columns in a table.

Parameters

string $table

Return Value

array

at line 45
string|array|null getPrimaryKey(string $table)

Returns table primary key.

Parameters

string $table

Return Value

string|array|null

at line 50
string|null getPrimaryAutoincrementKey(string $table)

Returns autoincrement primary key name.

Parameters

string $table

Return Value

string|null

at line 55
string|null getPrimaryKeySequence(string $table)

Returns table primary key sequence.

Parameters

string $table

Return Value

string|null

at line 61
array|null getHasManyReference(string $table)

Returns tables referencing the given table via foreign key, or null if unknown.

Parameters

string $table

Return Value

array|null

referencing table name => list of referencing columns

at line 67
array|null getBelongsToReference(string $table)

Returns foreign key columns in the given table mapped to their referenced tables, or null if unknown.

Parameters

string $table

Return Value

array|null

local column name => referenced table name

at line 72
void rebuild()

Rebuilds database structure cache.

Return Value

void

at line 77
bool isRebuilt()

Checks whether the structure has been rebuilt from the database during this request.

Return Value

bool