Structure
class Structure implements IStructure
Provides database structure metadata with caching.
Properties
| protected | $cache | ||
| protected | $structure | ||
| protected | $isRebuilt |
Methods
No description
Returns all columns in a table.
No description
Returns the name of the autoincrement primary key column, or null if none exists.
Returns the sequence name for the primary key column, or null if not applicable.
No description
No description
Rebuilds structure cache.
Checks whether the structure has been rebuilt from the database during this request.
Ensures the structure is loaded, from cache or from the database.
Loads complete structure from database.
No description
No description
Returns normalized table name.
Details
at line 26
__construct(Connection $connection, Storage $cacheStorage)
No description
at line 35
array
getTables()
No description
at line 42
array
getColumns(string $table)
Returns all columns in a table.
at line 54
string|array|null
getPrimaryKey(string $table)
No description
at line 65
string|null
getPrimaryAutoincrementKey(string $table)
Returns the name of the autoincrement primary key column, or null if none exists.
at line 98
string|null
getPrimaryKeySequence(string $table)
Returns the sequence name for the primary key column, or null if not applicable.
at line 124
array|null
getHasManyReference(string $table)
No description
at line 133
array|null
getBelongsToReference(string $table)
No description
at line 144
void
rebuild()
Rebuilds structure cache.
at line 154
bool
isRebuilt()
Checks whether the structure has been rebuilt from the database during this request.
at line 163
protected void
needStructure()
Ensures the structure is loaded, from cache or from the database.
at line 177
protected array
loadStructure()
Loads complete structure from database.
at line 216
protected string|array|null
analyzePrimaryKey(array $columns)
No description
at line 236
protected void
analyzeForeignKeys(array $structure, string $table)
No description
at line 265
protected string
resolveFQTableName(string $table)
Returns normalized table name.