class Structure

internal  
 

Provides database structure metadata with caching.

Properties

protected $structure
protected $isRebuilt

Methods

__construct(Engine $engine, Cache $cache)

No description

array
getTables()

No description

array
getColumns(string $table)

No description

string|array|null
getPrimaryKey(string $table)

No description

string|null
getPrimaryAutoincrementKey(string $table)

No description

string|null
getPrimaryKeySequence(string $table)

No description

array
getHasManyReference(string $table)

No description

array
getBelongsToReference(string $table)

No description

void
rebuild()

Rebuilds structure cache.

bool
isRebuilt()

No description

void
needStructure()

No description

array
loadStructure()

Loads complete structure from database.

string|array|null
analyzePrimaryKey(array $columns)

No description

void
analyzeForeignKeys(array $structure, string $table)

No description

string
resolveFQTableName(string $table)

Returns normalized table name.

Details

at line 27
__construct(Engine $engine, Cache $cache)

No description

Parameters

Engine $engine
Cache $cache

at line 34
array getTables()

No description

Return Value

array

at line 41
array getColumns(string $table)

No description

Parameters

string $table

Return Value

array

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

No description

Parameters

string $table

Return Value

string|array|null

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

No description

Parameters

string $table

Return Value

string|null

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

No description

Parameters

string $table

Return Value

string|null

at line 116
array getHasManyReference(string $table)

No description

Parameters

string $table

Return Value

array

at line 124
array getBelongsToReference(string $table)

No description

Parameters

string $table

Return Value

array

at line 135
void rebuild()

Rebuilds structure cache.

Return Value

void

at line 142
bool isRebuilt()

No description

Return Value

bool

at line 148
protected void needStructure()

No description

Return Value

void

at line 161
protected array loadStructure()

Loads complete structure from database.

Return Value

array

at line 194
protected string|array|null analyzePrimaryKey(array $columns)

No description

Parameters

array $columns

Return Value

string|array|null

at line 213
protected void analyzeForeignKeys(array $structure, string $table)

No description

Parameters

array $structure
string $table

Return Value

void

at line 235
protected string resolveFQTableName(string $table)

Returns normalized table name.

Parameters

string $table

Return Value

string