class CachingHelper implements ProtectedContextAwareInterface (View source)

Caching helper to make cache tag generation easier.

Properties

protected ContentRepositoryRegistry $contentRepositoryRegistry

Methods

array
convertArrayOfNodesToArrayOfNodeIdentifiersWithPrefix(mixed $nodes, string $prefix)

Render a caching configuration for array of Nodes

array
nodeTag(mixed $nodes)

Generate a @cache entry tag for a single node, array of nodes or a FlowQuery result A cache entry with this tag will be flushed whenever one of the given nodes (for any variant) is updated.

NodeCacheEntryIdentifier
entryIdentifierForNode(Node $node)

No description

string
nodeTagForIdentifier(string $identifier, Node $contextNode = null)

Generate a @cache entry tag for a single node identifier. If a Node $contextNode is given the entry tag will respect the workspace hash.

string|string[]
nodeTypeTag(string|NodeType|string[]|NodeType[]|Traversable<string>|NodeType> $nodeType, Node $contextNode = null)

Generate an @cache entry tag for a node type A cache entry with this tag will be flushed whenever a node (for any variant) that is of the given node type(s) (including inheritance) is updated.

string
getNodeTypeTagFor(string|NodeType $nodeType, Node $contextNode = null)

No description

array
descendantOfTag(mixed $nodes)

Generate a @cache entry tag for descendants of a node, an array of nodes or a FlowQuery result A cache entry with this tag will be flushed whenever a node (for any variant) that is a descendant (child on any level) of one of the given nodes is updated.

array
getWorkspaceChain(Node|null $node)

No description

bool
allowsCallOfMethod(string $methodName)

All methods are considered safe

Details

protected array convertArrayOfNodesToArrayOfNodeIdentifiersWithPrefix(mixed $nodes, string $prefix)

Render a caching configuration for array of Nodes

Parameters

mixed $nodes
string $prefix

Return Value

array

Exceptions

Exception

array nodeTag(mixed $nodes)

Generate a @cache entry tag for a single node, array of nodes or a FlowQuery result A cache entry with this tag will be flushed whenever one of the given nodes (for any variant) is updated.

Parameters

mixed $nodes

(A single Node or array or \Traversable of Nodes)

Return Value

array

Exceptions

Exception

NodeCacheEntryIdentifier entryIdentifierForNode(Node $node)

No description

Parameters

Node $node

Return Value

NodeCacheEntryIdentifier

string nodeTagForIdentifier(string $identifier, Node $contextNode = null)

Generate a @cache entry tag for a single node identifier. If a Node $contextNode is given the entry tag will respect the workspace hash.

Parameters

string $identifier
Node $contextNode

Return Value

string

string|string[] nodeTypeTag(string|NodeType|string[]|NodeType[]|Traversable<string>|NodeType> $nodeType, Node $contextNode = null)

Generate an @cache entry tag for a node type A cache entry with this tag will be flushed whenever a node (for any variant) that is of the given node type(s) (including inheritance) is updated.

Parameters

string|NodeType|string[]|NodeType[]|Traversable<string>|NodeType> $nodeType
Node $contextNode

Return Value

string|string[]

protected string getNodeTypeTagFor(string|NodeType $nodeType, Node $contextNode = null)

No description

Parameters

string|NodeType $nodeType
Node $contextNode

Return Value

string

array descendantOfTag(mixed $nodes)

Generate a @cache entry tag for descendants of a node, an array of nodes or a FlowQuery result A cache entry with this tag will be flushed whenever a node (for any variant) that is a descendant (child on any level) of one of the given nodes is updated.

Parameters

mixed $nodes

(A single Node or array or \Traversable of Nodes)

Return Value

array

Exceptions

Exception

array getWorkspaceChain(Node|null $node)

No description

Parameters

Node|null $node

Return Value

array

bool allowsCallOfMethod(string $methodName)

All methods are considered safe

Parameters

string $methodName

Return Value

bool