From 0db90e304b93182cc89f2e46da825eb8ff6b7c5e Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sun, 26 May 2024 09:41:26 +0200 Subject: [PATCH] TASK: Move `NodeCacheEntryIdentifier` to Fusion namespace --- .../Cache}/NodeCacheEntryIdentifier.php | 2 +- Neos.Neos/Classes/Fusion/Helper/CachingHelper.php | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) rename Neos.Neos/Classes/{Domain/Model => Fusion/Cache}/NodeCacheEntryIdentifier.php (96%) diff --git a/Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php b/Neos.Neos/Classes/Fusion/Cache/NodeCacheEntryIdentifier.php similarity index 96% rename from Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php rename to Neos.Neos/Classes/Fusion/Cache/NodeCacheEntryIdentifier.php index efbf48f7da2..40a9315a24f 100644 --- a/Neos.Neos/Classes/Domain/Model/NodeCacheEntryIdentifier.php +++ b/Neos.Neos/Classes/Fusion/Cache/NodeCacheEntryIdentifier.php @@ -12,7 +12,7 @@ declare(strict_types=1); -namespace Neos\Neos\Domain\Model; +namespace Neos\Neos\Fusion\Cache; use Neos\Flow\Annotations as Flow; use Neos\Cache\CacheAwareInterface; diff --git a/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php b/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php index 5901939576b..fb64a7a175b 100644 --- a/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php +++ b/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php @@ -22,7 +22,7 @@ use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Eel\ProtectedContextAwareInterface; use Neos\Flow\Annotations as Flow; -use Neos\Neos\Domain\Model\NodeCacheEntryIdentifier; +use Neos\Neos\Fusion\Cache\NodeCacheEntryIdentifier; use Neos\Neos\Fusion\Cache\CacheTag; use Neos\Neos\Fusion\Cache\CacheTagSet; @@ -56,6 +56,14 @@ public function nodeTag(iterable|Node $nodes): array return CacheTagSet::forNodeAggregatesFromNodes(Nodes::fromArray($nodes))->toStringArray(); } + /** + * Generate a `@cache` entry identifier for a given node: + * + * entryIdentifier { + * documentNode = ${Neos.Caching.entryIdentifierForNode(documentNode)} + * } + * + */ public function entryIdentifierForNode(Node $node): NodeCacheEntryIdentifier { return NodeCacheEntryIdentifier::fromNode($node);