tableCache[$database])) { $this->tableCache[$database] = $tables + $this->tableCache[$database]; } else { $this->tableCache[$database] = $tables; } } /** * Set an item in the cache */ public function cacheTableValue(string $db, string $table, string $key, string|int|null $value): void { $this->tableCache[$db][$table][$key] = $value; } /** * Get a cached value from table cache. * * @param T $key * * @return (T is null ? (string|int|null)[] : (string|int|null))|null * * @template T of string|null */ public function getCachedTableContent(string $db, string $table, string|null $key = null): array|string|int|null { if ($key === null) { return $this->tableCache[$db][$table] ?? null; } return $this->tableCache[$db][$table][$key] ?? null; } public function clearTableCache(): void { $this->tableCache = []; } }