CoolCMS API

CacheTagInvalidator
in package

FinalYes

Invalidates tag versions after the commit; fail-open.

Runs outside the transaction and must not break data that is already saved (an exception only goes to the log).

bumpFor() and bumpForClass() increment the tag of the class plus the classes of its owned cascade collections (from Doctrine metadata: saving or deleting a parent must invalidate lists of inlined children too) plus optional $extraTags (e.g. additionalCacheTags() of a manager: Comment bumps CommentThread because of the comment_count database trigger).

bumpTag() and bumpTags() bump explicit classes (raw-DBAL paths, deleteAll(), tree deletes), which bypass the completed hooks.

Table of Contents

Properties

$em  : EntityManagerInterface
$stats  : CacheStats|null
$tagVersions  : TagVersions

Methods

__construct()  : mixed
bumpFor()  : void
bumpForClass()  : void
bumpTag()  : void
bumpTags()  : void
ownedCascadeClasses()  : array<string|int, string>
Returns the root class plus the classes of its owned collections (cascade persist/remove or orphan removal). They are inlined in the cached parent graph, so writing the parent must bump their list tags too.

Properties

Methods

bumpFor()

public bumpFor(object $entity[, array<string|int, string> $extraTags = [] ]) : void
Parameters
$entity : object
$extraTags : array<string|int, string> = []

extra tag FQCNs (e.g. from additionalCacheTags())

bumpForClass()

public bumpForClass(class-string $rootClass[, array<string|int, string> $extraTags = [] ]) : void
Parameters
$rootClass : class-string
$extraTags : array<string|int, string> = []

bumpTags()

public bumpTags(array<string|int, string> $classes) : void
Parameters
$classes : array<string|int, string>

ownedCascadeClasses()

Returns the root class plus the classes of its owned collections (cascade persist/remove or orphan removal). They are inlined in the cached parent graph, so writing the parent must bump their list tags too.

private ownedCascadeClasses(class-string $rootClass) : array<string|int, string>
Parameters
$rootClass : class-string
Return values
array<string|int, string>
On this page

Search results