Structure
class Structure implements IStructure
Cached reflection of database structure.
Properties
protected Connection | $connection | ||
protected Cache | $cache | ||
protected array | $structure | ||
protected bool | $isRebuilt |
Methods
Returns tables list.
Returns table columns list.
No description
Returns autoincrement primary key name.
Returns table primary key sequence.
Returns hasMany reference.
Returns belongsTo reference.
Rebuilds database structure cache.
Returns true if database cached structure has been rebuilt.
No description
No description
No description
No description
No description
Details
at line 35
__construct(Connection $connection, IStorage $cacheStorage)
No description
at line 42
array
getTables()
Returns tables list.
at line 49
array
getColumns(string $table)
Returns table columns list.
at line 61
string|string[]|null
getPrimaryKey(string $table)
No description
at line 69
string|null
getPrimaryAutoincrementKey(string $table)
Returns autoincrement primary key name.
at line 98
string|null
getPrimaryKeySequence(string $table)
Returns table primary key sequence.
at line 123
array|null
getHasManyReference(string $table, string $targetTable = null)
Returns hasMany reference.
If a targetTable is not provided, returns references for all tables.
at line 144
array|null
getBelongsToReference(string $table, string $column = null)
Returns belongsTo reference.
If a column is not provided, returns references for all columns.
at line 161
void
rebuild()
Rebuilds database structure cache.
at line 168
bool
isRebuilt()
Returns true if database cached structure has been rebuilt.
at line 174
protected void
needStructure()
No description
at line 184
protected array
loadStructure()
No description
at line 221
protected
analyzePrimaryKey(array $columns)
No description
at line 240
protected void
analyzeForeignKeys(array $structure, string $table)
No description
at line 268
protected string
resolveFQTableName(string $table)
No description
Traits
Strict class for better experience.