diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php index 4100d614945..d2abbcb8eef 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php @@ -454,15 +454,9 @@ public function countNodes(): int } } - /** - * @return array - */ - public function jsonSerialize(): array + public function jsonSerialize(): ContentSubgraphIdentity { - return [ - 'contentStreamId' => $this->contentStreamId, - 'dimensionSpacePoint' => $this->dimensionSpacePoint - ]; + return $this->getIdentity(); } /** ------------------------------------------- */ diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php index 32705839a97..0505f70ab5d 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php @@ -532,14 +532,8 @@ private function getDatabaseConnection(): DatabaseConnection return $this->databaseClient->getConnection(); } - /** - * @return array - */ - public function jsonSerialize(): array + public function jsonSerialize(): ContentSubgraphIdentity { - return [ - 'contentStreamId' => $this->contentStreamId, - 'dimensionSpacePoint' => $this->dimensionSpacePoint - ]; + return $this->getIdentity(); } } diff --git a/Neos.ContentRepository.Core/Classes/Factory/ContentRepositoryId.php b/Neos.ContentRepository.Core/Classes/Factory/ContentRepositoryId.php index 3fc383c9812..1647044092c 100644 --- a/Neos.ContentRepository.Core/Classes/Factory/ContentRepositoryId.php +++ b/Neos.ContentRepository.Core/Classes/Factory/ContentRepositoryId.php @@ -19,7 +19,7 @@ * * @api */ -final class ContentRepositoryId +final class ContentRepositoryId implements \JsonSerializable { private function __construct( public readonly string $value @@ -47,4 +47,9 @@ public function equals(self $other): bool { return $this->value === $other->value; } + + public function jsonSerialize(): mixed + { + return $this->value; + } } diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php index 7660d7c154d..02a37622d0a 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php @@ -262,7 +262,7 @@ private static function isFilterEmpty(object $filter): bool return array_filter(get_object_vars($filter), static fn ($value) => $value !== null) === []; } - public function jsonSerialize(): mixed + public function jsonSerialize(): ContentSubgraphIdentity { return $this->wrappedContentSubgraph->jsonSerialize(); } diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphIdentity.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphIdentity.php index 3bc447f0e11..821b52b1fde 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphIdentity.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphIdentity.php @@ -33,7 +33,7 @@ * * @api */ -final class ContentSubgraphIdentity +final class ContentSubgraphIdentity implements \JsonSerializable { private function __construct( public readonly ContentRepositoryId $contentRepositoryId, @@ -90,4 +90,17 @@ public function withVisibilityConstraints(VisibilityConstraints $visibilityConst $visibilityConstraints ); } + + /** + * @return array + */ + public function jsonSerialize(): array + { + return [ + 'contentRepositoryId' => $this->contentRepositoryId, + 'contentStreamId' => $this->contentStreamId, + 'dimensionSpacePoint' => $this->dimensionSpacePoint, + 'visibilityConstraints' => $this->visibilityConstraints + ]; + } } diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php index 5f65fb6a0f1..4c2872f5804 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php @@ -209,4 +209,6 @@ public function retrieveNodePath(NodeAggregateId $nodeAggregateId): AbsoluteNode * @internal this method might change without further notice. */ public function countNodes(): int; + + public function jsonSerialize(): ContentSubgraphIdentity; } diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/VisibilityConstraints.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/VisibilityConstraints.php index e8404c11b21..8a2ab3168bc 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/VisibilityConstraints.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/VisibilityConstraints.php @@ -21,7 +21,7 @@ * * @api */ -final class VisibilityConstraints +final class VisibilityConstraints implements \JsonSerializable { protected bool $disabledContentShown = false; @@ -49,4 +49,9 @@ public static function frontend(): VisibilityConstraints { return new VisibilityConstraints(false); } + + public function jsonSerialize(): string + { + return $this->getHash(); + } }