CacheFlushDemand

final readonly class \TYPO3\CMS\Core\Cache\Flush\CacheFlushDemand

Describes what should be flushed: changed records, pages, cache tags, cache groups or cache commands as known from "TCEMAIN.clearCacheCmd".

Table of Contents

Properties

$commands  : array
$groups  : array
$pageIds  : array
$records  : array
$tags  : array

Methods

create()  : self
forCommand()  : self
A cache command as known from "TCEMAIN.clearCacheCmd": "pages", "all", a page id or "cacheTag:<tag>". Other commands are passed on untouched, so event listeners can react to them.
forGroups()  : self
Flushes all caches of cache groups, or all caches for the group "all".
forPageTagsByPageIds()  : self
Flushes the cache tags "pageId_<uid>" of the pages only, without resolving related pages or Page TSconfig. Use forRecord('pages', $uid) to flush a page the way DataHandler does when it is saved.
forRecord()  : self
Flushes the caches of the page a record is located on, including the configuration of "TCEMAIN.clearCache_*" and "TCEMAIN.clearCacheCmd".
forTags()  : self
Flushes cache tags in the caches of the "pages" group.
forTagsInGroup()  : self
Flushes cache tags in the caches of a cache group, or in all caches for the group "all".
isEmpty()  : bool
withGroups()  : self
Flushes all caches of cache groups, or all caches for the group "all".
withRecord()  : self
withTagsInGroup()  : self
Flushes cache tags in the caches of a cache group, or in all caches for the group "all".

Properties

Methods

create()

public static create() : self

Return values

self

forCommand()

A cache command as known from "TCEMAIN.clearCacheCmd": "pages", "all", a page id or "cacheTag:<tag>". Other commands are passed on untouched, so event listeners can react to them.

public static forCommand(int|string $command) : self

Parameters

$command : int|string

Return values

self

forGroups()

Flushes all caches of cache groups, or all caches for the group "all".

public static forGroups(string ...$groups) : self

Parameters

$groups : string

Return values

self

forPageTagsByPageIds()

Flushes the cache tags "pageId_<uid>" of the pages only, without resolving related pages or Page TSconfig. Use forRecord('pages', $uid) to flush a page the way DataHandler does when it is saved.

public static forPageTagsByPageIds(int ...$pageIds) : self

Parameters

$pageIds : int

Return values

self

forRecord()

Flushes the caches of the page a record is located on, including the configuration of "TCEMAIN.clearCache_*" and "TCEMAIN.clearCacheCmd".

public static forRecord(string $table, int $uid[, int|null $originalPageId = null ]) : self

Parameters

$table : string
$uid : int
$originalPageId : int|null = null

The page the record was located on before it was moved or deleted

Return values

self

forTags()

Flushes cache tags in the caches of the "pages" group.

public static forTags(string ...$tags) : self

Parameters

$tags : string

Return values

self

forTagsInGroup()

Flushes cache tags in the caches of a cache group, or in all caches for the group "all".

public static forTagsInGroup(string $group, string ...$tags) : self

Parameters

$group : string
$tags : string

Return values

self

isEmpty()

public isEmpty() : bool

Return values

bool

withGroups()

Flushes all caches of cache groups, or all caches for the group "all".

public withGroups(string ...$groups) : self

Parameters

$groups : string

Return values

self

withRecord()

public withRecord(string $table, int $uid[, int|null $originalPageId = null ]) : self

Parameters

$table : string
$uid : int
$originalPageId : int|null = null

The page the record was located on before it was moved or deleted

Return values

self

withTagsInGroup()

Flushes cache tags in the caches of a cache group, or in all caches for the group "all".

public withTagsInGroup(string $group, string ...$tags) : self

Parameters

$group : string
$tags : string

Return values

self
On this page