\Drupflare\Anachron\Drupal\Cache LegacyTables

Turns the tables a legacy query touches into cache tags.

A table that legacy code owns is tagged by name, and every shim write to it invalidates the tag. A table of a Drupal 11 entity type is also tagged with the type's list tag, which core invalidates on every save. Any other table core owns has writers the shims never see, so a read of it makes the page uncacheable.

Summary

Methods
Properties
Constants
forget
read
write
readQuery
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
entityTables
coreTables
entityTables
coreTables
No private constants found

Properties

$entityTables

$entityTables : array|null

The value kept for this request.

Type

array<string, string>|null —

$coreTables

$coreTables : array|null

The value kept for this request.

Type

array<string, true>|null —

Methods

forget()

forget() : void

Drops the memoized table lists.

Returns

void —

read()

read(list  $tables) : void

Adds the tags of something legacy code read.

Parameters

list $tables

The table names.

Returns

void —

write()

write(list  $tables) : void

Invalidates the tags of tables a legacy write touched.

Parameters

list $tables

The table names.

Returns

void —

readQuery()

readQuery(string  $sql) : void

Reads a query string, or tags the broad tag when its tables cannot be named.

Parameters

string $sql

Returns

void —

entityTables()

entityTables() : array<string,string>

Maps entity table names to their entity type.

Returns

array —

Entity type ids keyed by table name.

coreTables()

coreTables() : array<string,true>

Lists the tables core modules declare.

Returns

array —

Table names as keys.