Repository navigation
Internals Database Interface ICache
Framework Internals · Subsystem overview · Developer guide
Source: awt_src/classes/database/interface/ICache.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 ICacheSource description (behavioral corrections are recorded in Known discrepancies):
Contract for the query result cache.
The cache is keyed by (table, opaque query key). DatabaseManager includes SQL and bindings in that key. Fine-grained invalidation is driven by the raw WHERE conditions that were active when the query was cached, enabling column-value–level eviction (e.g. "invalidate everything cached for users WHERE name = 'Alice'").
No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.
| Method | Signature |
|---|---|
| get | public function get(string $table, string $query): array|false |
| set | public function set(string $table, string $query, array $result, array $conditions): void |
| invalidate | public function invalidate(string $table, array $cudConditions): void |
| invalidateTable | public function invalidateTable(string $table): void |
public function get(string $table, string $query): array|false;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$table |
string $table |
The primary table the query targets. |
$query |
string $query |
The opaque query cache key. |
Return cached rows for the given query, or false on a cache miss.
@param string $table The primary table the query targets. @param string $query The opaque query cache key.
@return array|false Cached rows on hit; false on miss.
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function set(string $table, string $query, array $result, array $conditions): void;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$table |
string $table |
The primary table. |
$query |
string $query |
The opaque query cache key. |
$result |
array $result |
The rows to cache. |
$conditions |
array $conditions |
Raw column → value WHERE pairs (used for |
Store query results together with the WHERE conditions that produced them.
@param string $table The primary table. @param string $query The opaque query cache key. @param array $result The rows to cache. @param array $conditions Raw column → value WHERE pairs (used for targeted invalidation later).
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function invalidate(string $table, array $cudConditions): void;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$table |
string $table |
The table being mutated. |
$cudConditions |
array $cudConditions |
Raw column → value pairs from the CUD WHERE clause. |
Invalidate cached queries that overlap with the given CUD conditions.
Rules:
- Queries cached without any WHERE conditions (full-table scans) are always invalidated on any CUD touching the same table.
- Queries cached WITH conditions are invalidated when at least one column+value pair from $cudConditions matches their stored conditions.
- When $cudConditions is empty (bulk / no-WHERE CUD), ALL cached queries for the table are invalidated.
@param string $table The table being mutated. @param array $cudConditions Raw column → value pairs from the CUD WHERE clause.
Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
public function invalidateTable(string $table): void;| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$table |
string $table |
Operation input; the exact use, validation and propagation are shown in the implementation trace. |
Unconditionally drop every cached entry for a table.
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