class Structure

internal  
 

Cached reflection of database structure.

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

No description

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

No description

void
rebuild()

No description

bool
isRebuilt()

No description

void
needStructure()

No description

array
loadStructure()

No description

string|array|null
analyzePrimaryKey(array $columns)

No description

void
analyzeForeignKeys(array $structure, string $table)

No description

string
resolveFQTableName(string $table)

No description

Details

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

No description

Parameters

Engine $engine
Cache $cache

at line 33
array getTables()

No description

Return Value

array

at line 40
array getColumns(string $table)

No description

Parameters

string $table

Return Value

array

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

No description

Parameters

string $table

Return Value

string|array|null

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

No description

Parameters

string $table

Return Value

string|null

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

No description

Parameters

string $table

Return Value

string|null

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

No description

Parameters

string $table
string|null $targetTable

Return Value

array|null

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

No description

Parameters

string $table
string|null $column

Return Value

array|null

at line 153
void rebuild()

No description

Return Value

void

at line 160
bool isRebuilt()

No description

Return Value

bool

at line 166
protected void needStructure()

No description

Return Value

void

at line 176
protected array loadStructure()

No description

Return Value

array

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

No description

Parameters

array $columns

Return Value

string|array|null

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

No description

Parameters

array $structure
string $table

Return Value

void

at line 247
protected string resolveFQTableName(string $table)

No description

Parameters

string $table

Return Value

string