class AnyTagSet extends TagSet

Any-mode tag set for Redis 8.0+ enhanced tagging.

Tags are identified by their names, and hashes track membership with HSETEX field expiration. Flush deletes the actual cache keys written with any of the specified tags.

Properties

protected RedisStore $store

The cache store implementation.

protected array $names

The tag names.

from  TagSet

Methods

__construct(Store $store, array $names = [])

Create a new AnyTagSet instance.

void
reset()

Reset the tag set.

void
flush()

Flush all tags in this set.

array
getNames()

Get all of the tag names in the set.

from  TagSet
string
tagHashKey(string $name)

Get the hash key for a tag.

entries()

Get all cache keys for this tag set (union of all tags).

string
flushTag(string $name)

Flush a single tag.

getRedisStore()

Get the store as a RedisStore instance.

Details

at line 31
__construct(Store $store, array $names = [])

Create a new AnyTagSet instance.

Parameters

Store $store
array $names

at line 73
void reset()

Reset the tag set.

In any mode, this deletes the cached items themselves, unlike namespaced tag sets where reset only invalidates tag tracking.

Return Value

void

at line 84
void flush()

Flush all tags in this set.

Deletes all cache items that have ANY of the specified tags (union semantics), along with their reverse indexes and tag hashes.

Return Value

void

in TagSet at line 43
array getNames()

Get all of the tag names in the set.

Return Value

array

at line 42
string tagHashKey(string $name)

Get the hash key for a tag.

Delegates to StoreContext which delegates to TagMode (single source of truth). Format: "{prefix}_any:tag:{tag}:entries"

Parameters

string $name

Return Value

string

at line 53
Generator entries()

Get all cache keys for this tag set (union of all tags).

This is a generator that yields unique keys across all tags. Used for listing tagged items or bulk operations.

Return Value

Generator

at line 92
string flushTag(string $name)

Flush a single tag.

Parameters

string $name

Return Value

string

at line 102
protected RedisStore getRedisStore()

Get the store as a RedisStore instance.

Return Value

RedisStore