CacheFlushDemand
final readonly class \
Describes what should be flushed: changed records, pages, cache tags, cache groups or cache commands as known from "TCEMAIN.clearCacheCmd".
Table of Contents
Properties
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
$commands
public
array
$commands
= []
$groups
public
array
$groups
= []
$pageIds
public
array
$pageIds
= []
$records
public
array
$records
= []
$tags
public
array
$tags
= []
Methods
create()
public
static create() : self
Return values
selfforCommand()
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
selfforGroups()
Flushes all caches of cache groups, or all caches for the group "all".
public
static forGroups(string ...$groups) : self
Parameters
- $groups : string
Return values
selfforPageTagsByPageIds()
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
selfforRecord()
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
selfforTags()
Flushes cache tags in the caches of the "pages" group.
public
static forTags(string ...$tags) : self
Parameters
- $tags : string
Return values
selfforTagsInGroup()
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
selfisEmpty()
public
isEmpty() : bool
Return values
boolwithGroups()
Flushes all caches of cache groups, or all caches for the group "all".
public
withGroups(string ...$groups) : self
Parameters
- $groups : string
Return values
selfwithRecord()
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
selfwithTagsInGroup()
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