Repository navigation
Internals Database Creator Interface ITableRegistry
Framework Internals · Subsystem overview · Developer guide
Source: awt_src/classes/database/creator/interface/ITableRegistry.php · Snapshot 8411f4287706.
DatabaseManager delegates SQL generation to QueryBuilder, execution to IProvider, and result caching to ICache. Schema builders use MySQL DDL and the framework table registry.
interface ITableRegistrySource description (behavioral corrections are recorded in Known discrepancies):
ITableRegistry
Contract for reading and writing the framework's schema registry tables (awt_table and awt_table_structure).
The registry is a parallel record of every table and column managed by the framework. It exists alongside the real database schema so that the framework can query structural information without relying on INFORMATION_SCHEMA, which is not available in all configurations.
All registry mutations are performed through DatabaseManager so they benefit from the same caching and invalidation system as the rest of the application.
No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.
| Method | Signature |
|---|---|
| findByOwner | public function findByOwner(int $ownerId): array |
| tableExists | public function tableExists(string $name): bool |
| columnExists | public function columnExists(string $table, string $column): bool |
| getTableId | public function getTableId(string $name): ?int |
| registerTable | public function registerTable(string $name, int $creatorId): int |
| registerColumn | public function registerColumn(int $tableId, string $columnName, string $columnType): void |
| unregisterTable | public function unregisterTable(string $name): void |
| unregisterColumn | public function unregisterColumn(string $table, string $column): void |
| updateColumnType | public function updateColumnType(string $table, string $column, string $newType): void |
| renameColumn | public function renameColumn(string $table, string $oldName, string $newName): void |
public function findByOwner(int $ownerId): array;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$ownerId |
int $ownerId |
Owning record ID or null. |
@return string[] Names of tables created by the given package owner.
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function tableExists(string $name): bool;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$name |
string $name |
The table name to look up. |
Check whether a table is registered in the framework schema.
@param string $name The table name to look up.
@return bool True if the table exists in the registry.
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function columnExists(string $table, string $column): bool;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$table |
string $table |
The table to inspect. |
$column |
string $column |
The column name to look up. |
Check whether a column is registered for a specific table.
@param string $table The table to inspect. @param string $column The column name to look up.
@return bool True if the column is registered under that table.
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function getTableId(string $name): ?int;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$name |
string $name |
The table name. |
Retrieve the internal registry ID for a table.
@param string $name The table name.
@return int|null The ID, or null if the table is not registered.
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function registerTable(string $name, int $creatorId): int;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$name |
string $name |
The table name. |
$creatorId |
int $creatorId |
The package/plugin ID that created the table. |
Add a table entry to the registry and return the assigned ID.
@param string $name The table name. @param int $creatorId The package/plugin ID that created the table.
@return int The auto-increment ID assigned to the new registry entry.
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function registerColumn(int $tableId, string $columnName, string $columnType): void;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$tableId |
int $tableId |
The registry ID returned by registerTable(). |
$columnName |
string $columnName |
The column name. |
$columnType |
string $columnType |
The lowercase SQL type keyword (e.g. "int", "varchar"). |
Register a column under an existing table registry entry.
@param int $tableId The registry ID returned by registerTable(). @param string $columnName The column name. @param string $columnType The lowercase SQL type keyword (e.g. "int", "varchar").
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function unregisterTable(string $name): void;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$name |
string $name |
The table name to remove. |
Remove a table and all of its column entries from the registry. Does not drop the real database table; that is the provider's concern.
@param string $name The table name to remove.
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function unregisterColumn(string $table, string $column): void;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$table |
string $table |
The table that owns the column. |
$column |
string $column |
The column name to remove. |
Remove a single column entry from the registry. Does not alter the real database table; that is the provider's concern.
@param string $table The table that owns the column. @param string $column The column name to remove.
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function updateColumnType(string $table, string $column, string $newType): void;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$table |
string $table |
The table that owns the column. |
$column |
string $column |
The column whose type changed. |
$newType |
string $newType |
The new lowercase SQL type keyword. |
Update the registered type of an existing column. Called after MODIFY COLUMN to keep the registry in sync.
@param string $table The table that owns the column. @param string $column The column whose type changed. @param string $newType The new lowercase SQL type keyword.
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function renameColumn(string $table, string $oldName, string $newName): void;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$table |
string $table |
The table that owns the column. |
$oldName |
string $oldName |
The current column name. |
$newName |
string $newName |
The new column name. |
Rename a column entry in the registry. Called after RENAME COLUMN to keep the registry in sync.
@param string $table The table that owns the column. @param string $oldName The current column name. @param string $newName The new column name.
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
AWT Framework Wiki · Home · Installation Guide · Developer Guide · Framework Internals
Philosophy · Architecture · Known discrepancies · Verification
Installation Guide
Developer Guide
- Learning sequence
- First package
- Package structure
- Lifecycle
- Runtimes
- Events and objects
- Routing and controllers
- Views and resources
- Database and models
- Storage and caching
- Configuration and CLI
- Responses and errors
- Extension points
Framework Internals
- Architecture
- Bootstrap
- Packages
- Runtime
- Events and context
- Objects
- HTTP routing and controllers
- Rendering
- Blade integration
- Database
- Models
- Storage and caching
- Settings
- CLI
- Identity and sessions
- Responses
- Errors
- Complete source inventory
Documentation notes