interface IStructure

Provides cached reflection for database structure.

Constants

deprecated FIELD_TEXT

deprecated FIELD_BINARY

deprecated FIELD_BOOL

deprecated FIELD_INTEGER

deprecated FIELD_FLOAT

deprecated FIELD_DECIMAL

deprecated FIELD_DATE

deprecated FIELD_TIME

deprecated FIELD_DATETIME

deprecated FIELD_UNIX_TIMESTAMP

deprecated FIELD_TIME_INTERVAL

Methods

array
getTables()

Returns tables list.

array
getColumns(string $table)

Returns table columns list.

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, string|null $targetTable = null)

Returns hasMany reference.

array|null
getBelongsToReference(string $table, string|null $column = null)

Returns belongsTo reference.

void
rebuild()

Rebuilds database structure cache.

bool
isRebuilt()

Returns true if database cached structure has been rebuilt.

Details

at line 35
array getTables()

Returns tables list.

Return Value

array

at line 40
array getColumns(string $table)

Returns table columns list.

Parameters

string $table

Return Value

array

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

Returns table primary key.

Parameters

string $table

Return Value

string|array|null

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

Returns autoincrement primary key name.

Parameters

string $table

Return Value

string|null

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

Returns table primary key sequence.

Parameters

string $table

Return Value

string|null

at line 62
array|null getHasManyReference(string $table, string|null $targetTable = null)

Returns hasMany reference.

If a targetTable is not provided, returns references for all tables.

Parameters

string $table
string|null $targetTable

Return Value

array|null

at line 68
array|null getBelongsToReference(string $table, string|null $column = null)

Returns belongsTo reference.

If a column is not provided, returns references for all columns.

Parameters

string $table
string|null $column

Return Value

array|null

at line 73
void rebuild()

Rebuilds database structure cache.

Return Value

void

at line 78
bool isRebuilt()

Returns true if database cached structure has been rebuilt.

Return Value

bool