Structure
class Structure implements IStructure
Provides database structure metadata with caching.
Properties
| protected | $connection | ||
| protected | $cache | ||
| protected | $structure | ||
| protected | $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 structure cache.
Returns true if database cached structure has been rebuilt.
No description
Loads complete structure from database.
No description
No description
Returns normalized table name.
Details
at line 29
__construct(Connection $connection, Storage $cacheStorage)
No description
at line 36
array
getTables()
Returns tables list.
at line 43
array
getColumns(string $table)
Returns table columns list.
at line 55
string|array|null
getPrimaryKey(string $table)
No description
at line 63
string|null
getPrimaryAutoincrementKey(string $table)
Returns autoincrement primary key name.
at line 93
string|null
getPrimaryKeySequence(string $table)
Returns table primary key sequence.
at line 118
array|null
getHasManyReference(string $table)
Returns hasMany reference.
If a targetTable is not provided, returns references for all tables.
at line 126
array|null
getBelongsToReference(string $table)
Returns belongsTo reference.
If a column is not provided, returns references for all columns.
at line 137
void
rebuild()
Rebuilds structure cache.
at line 144
bool
isRebuilt()
Returns true if database cached structure has been rebuilt.
at line 150
protected void
needStructure()
No description
at line 163
protected array
loadStructure()
Loads complete structure from database.
at line 198
protected string|array|null
analyzePrimaryKey(array $columns)
No description
at line 217
protected void
analyzeForeignKeys(array $structure, string $table)
No description
at line 245
protected string
resolveFQTableName(string $table)
Returns normalized table name.