Skip to content

Internals Database Creator Interface ITableRegistry

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

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.

ITableRegistry

Declaration and architectural role

interface ITableRegistry

Source 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.

Constants, enum cases, traits and properties

No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.

Method index

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

findByOwner

Source line 23

public function findByOwner(int $ownerId): array;

Parameters

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.

tableExists

Source line 32

public function tableExists(string $name): bool;

Parameters

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.

columnExists

Source line 42

public function columnExists(string $table, string $column): bool;

Parameters

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.

getTableId

Source line 51

public function getTableId(string $name): ?int;

Parameters

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.

registerTable

Source line 61

public function registerTable(string $name, int $creatorId): int;

Parameters

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.

registerColumn

Source line 70

public function registerColumn(int $tableId, string $columnName, string $columnType): void;

Parameters

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.

unregisterTable

Source line 78

public function unregisterTable(string $name): void;

Parameters

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.

unregisterColumn

Source line 87

public function unregisterColumn(string $table, string $column): void;

Parameters

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.

updateColumnType

Source line 97

public function updateColumnType(string $table, string $column, string $newType): void;

Parameters

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.

renameColumn

Source line 107

public function renameColumn(string $table, string $oldName, string $newName): void;

Parameters

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.

Clone this wiki locally