From d38fd9d5e53aca307899a3d9697ea98bfd7dd1e5 Mon Sep 17 00:00:00 2001 From: Denny Lubitz Date: Wed, 28 Aug 2024 11:36:13 +0200 Subject: [PATCH 1/5] TASK: Split up EmbedsContentStreamAndNodeAggregateId interface into EmbedsContentStreamId and EmbedsNodeAggregateId and add EmbedsWorkspaceName interface --- .../EmbedsContentStreamAndNodeAggregateId.php | 8 ++--- .../Feature/Common/EmbedsContentStreamId.php | 29 +++++++++++++++++++ .../Feature/Common/EmbedsNodeAggregateId.php | 29 +++++++++++++++++++ .../Feature/Common/EmbedsWorkspaceName.php | 29 +++++++++++++++++++ .../Event/ContentStreamWasClosed.php | 8 ++++- .../Event/ContentStreamWasReopened.php | 8 ++++- .../Event/ContentStreamWasCreated.php | 8 ++++- .../Event/ContentStreamWasRemoved.php | 8 ++++- .../Event/DimensionShineThroughWasAdded.php | 14 ++++++++- .../Event/DimensionSpacePointWasMoved.php | 14 ++++++++- .../Event/NodeAggregateWithNodeWasCreated.php | 21 ++++++++++---- .../Event/NodeAggregateWasDisabled.php | 11 +++++++ .../Event/NodeAggregateWasEnabled.php | 11 +++++++ .../Event/NodePropertiesWereSet.php | 11 +++++++ .../NodeMove/Event/NodeAggregateWasMoved.php | 11 +++++++ .../Event/NodeReferencesWereSet.php | 11 +++++++ .../Event/NodeAggregateWasRemoved.php | 11 +++++++ .../Event/NodeAggregateNameWasChanged.php | 11 +++++++ .../Event/NodeAggregateTypeWasChanged.php | 11 +++++++ .../NodeGeneralizationVariantWasCreated.php | 15 ++++++++-- .../Event/NodePeerVariantWasCreated.php | 15 ++++++++-- .../NodeSpecializationVariantWasCreated.php | 16 ++++++++-- ...RootNodeAggregateDimensionsWereUpdated.php | 11 +++++++ .../RootNodeAggregateWithNodeWasCreated.php | 11 +++++++ .../SubtreeTagging/Event/SubtreeWasTagged.php | 11 +++++++ .../Event/SubtreeWasUntagged.php | 11 +++++++ .../Event/RootWorkspaceWasCreated.php | 9 +++++- .../Event/WorkspaceWasCreated.php | 8 ++++- .../WorkspaceBaseWorkspaceWasChanged.php | 8 ++++- .../Event/WorkspaceOwnerWasChanged.php | 8 ++++- .../Event/WorkspaceWasRemoved.php | 8 ++++- .../Event/WorkspaceWasRenamed.php | 8 ++++- .../Event/WorkspaceWasDiscarded.php | 8 ++++- .../Event/WorkspaceWasPartiallyDiscarded.php | 8 ++++- .../Event/WorkspaceRebaseFailed.php | 8 ++++- .../Event/WorkspaceWasRebased.php | 8 ++++- .../ContentStream/ContentStreamProjection.php | 9 +++--- ...phProjectorCatchUpHookForCacheFlushing.php | 6 ++-- 38 files changed, 410 insertions(+), 40 deletions(-) create mode 100644 Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamId.php create mode 100644 Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsNodeAggregateId.php create mode 100644 Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsWorkspaceName.php diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php index 7c8ab207d76..722cdddac5e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php @@ -14,18 +14,14 @@ namespace Neos\ContentRepository\Core\Feature\Common; -use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; -use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; - /** * This interface is implemented by **events** which contain ContentStreamId and NodeAggregateId. * * This is relevant e.g. for content cache flushing as a result of an event. * * @internal + * @deprecated Use {@see EmbedsContentStreamId} and/or {@see EmbedsNodeAggregateId} instead. Will be removed with Neos 10. */ -interface EmbedsContentStreamAndNodeAggregateId +interface EmbedsContentStreamAndNodeAggregateId extends EmbedsContentStreamId, EmbedsNodeAggregateId { - public function getContentStreamId(): ContentStreamId; - public function getNodeAggregateId(): NodeAggregateId; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamId.php b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamId.php new file mode 100644 index 00000000000..38c04d3dae6 --- /dev/null +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamId.php @@ -0,0 +1,29 @@ +contentStreamId; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Event/ContentStreamWasReopened.php b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Event/ContentStreamWasReopened.php index bd772de5f6a..7e727cf998f 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Event/ContentStreamWasReopened.php +++ b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamClosing/Event/ContentStreamWasReopened.php @@ -15,13 +15,14 @@ namespace Neos\ContentRepository\Core\Feature\ContentStreamClosing\Event; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamState; /** * @api events are the persistence-API of the content repository */ -final readonly class ContentStreamWasReopened implements EventInterface +final readonly class ContentStreamWasReopened implements EventInterface, EmbedsContentStreamId { public function __construct( public ContentStreamId $contentStreamId, @@ -29,6 +30,11 @@ public function __construct( ) { } + public function getContentStreamId(): ContentStreamId + { + return $this->contentStreamId; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamCreation/Event/ContentStreamWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamCreation/Event/ContentStreamWasCreated.php index d3897414f67..0cdec90c945 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamCreation/Event/ContentStreamWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamCreation/Event/ContentStreamWasCreated.php @@ -15,6 +15,7 @@ namespace Neos\ContentRepository\Core\Feature\ContentStreamCreation\Event; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; /** @@ -23,13 +24,18 @@ * * @api events are the persistence-API of the content repository */ -final readonly class ContentStreamWasCreated implements EventInterface +final readonly class ContentStreamWasCreated implements EventInterface, EmbedsContentStreamId { public function __construct( public ContentStreamId $contentStreamId, ) { } + public function getContentStreamId(): ContentStreamId + { + return $this->contentStreamId; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamRemoval/Event/ContentStreamWasRemoved.php b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamRemoval/Event/ContentStreamWasRemoved.php index 0d88f9c0dbc..30918f2bdb9 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamRemoval/Event/ContentStreamWasRemoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamRemoval/Event/ContentStreamWasRemoved.php @@ -15,18 +15,24 @@ */ use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; /** * @api events are the persistence-API of the content repository */ -final readonly class ContentStreamWasRemoved implements EventInterface +final readonly class ContentStreamWasRemoved implements EventInterface, EmbedsContentStreamId { public function __construct( public ContentStreamId $contentStreamId, ) { } + public function getContentStreamId(): ContentStreamId + { + return $this->contentStreamId; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php index 3b4a03ef1c3..e6806c40b84 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php @@ -16,6 +16,8 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -33,7 +35,7 @@ * * @api events are the persistence-API of the content repository */ -final readonly class DimensionShineThroughWasAdded implements EventInterface, PublishableToWorkspaceInterface +final readonly class DimensionShineThroughWasAdded implements EventInterface, PublishableToWorkspaceInterface, EmbedsContentStreamId, EmbedsWorkspaceName { public function __construct( public WorkspaceName $workspaceName, @@ -43,6 +45,16 @@ public function __construct( ) { } + public function getContentStreamId(): ContentStreamId + { + return $this->contentStreamId; + } + + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php index a65486a3eeb..2e9c014c672 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php @@ -16,6 +16,8 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -29,7 +31,7 @@ * * @api events are the persistence-API of the content repository */ -final readonly class DimensionSpacePointWasMoved implements EventInterface, PublishableToWorkspaceInterface +final readonly class DimensionSpacePointWasMoved implements EventInterface, PublishableToWorkspaceInterface, EmbedsContentStreamId, EmbedsWorkspaceName { public function __construct( public WorkspaceName $workspaceName, @@ -39,6 +41,16 @@ public function __construct( ) { } + public function getContentStreamId(): ContentStreamId + { + return $this->contentStreamId; + } + + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php index 0141ffd51e4..5cec47b04f1 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php @@ -18,6 +18,9 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; @@ -36,6 +39,9 @@ final readonly class NodeAggregateWithNodeWasCreated implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -62,6 +68,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getOriginDimensionSpacePoint(): OriginDimensionSpacePoint { return $this->originDimensionSpacePoint; @@ -94,11 +105,11 @@ public static function fromArray(array $values): self array_key_exists('succeedingSiblingsForCoverage', $values) ? InterdimensionalSiblings::fromArray($values['succeedingSiblingsForCoverage']) : InterdimensionalSiblings::fromDimensionSpacePointSetWithSingleSucceedingSiblings( - DimensionSpacePointSet::fromArray($values['coveredDimensionSpacePoints']), - isset($values['succeedingNodeAggregateId']) - ? NodeAggregateId::fromString($values['succeedingNodeAggregateId']) - : null, - ), + DimensionSpacePointSet::fromArray($values['coveredDimensionSpacePoints']), + isset($values['succeedingNodeAggregateId']) + ? NodeAggregateId::fromString($values['succeedingNodeAggregateId']) + : null, + ), NodeAggregateId::fromString($values['parentNodeAggregateId']), isset($values['nodeName']) ? NodeName::fromString($values['nodeName']) : null, SerializedPropertyValues::fromArray($values['initialPropertyValues']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php index b16de3060ec..188e843a4d7 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php @@ -17,6 +17,9 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasTagged; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -32,6 +35,9 @@ final readonly class NodeAggregateWasDisabled implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -53,6 +59,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php index 6c0ef1aeac6..e8fe1aef74c 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php @@ -18,6 +18,9 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\EventStore\EventNormalizer; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasUntagged; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -33,6 +36,9 @@ final readonly class NodeAggregateWasEnabled implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -53,6 +59,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php index 6827196656e..4b02f4caf1f 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php @@ -18,6 +18,9 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -39,6 +42,9 @@ final readonly class NodePropertiesWereSet implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -63,6 +69,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getOriginDimensionSpacePoint(): OriginDimensionSpacePoint { return $this->originDimensionSpacePoint; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php index 59c91213655..300604a362c 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php @@ -7,6 +7,9 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSibling; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; @@ -52,6 +55,9 @@ final readonly class NodeAggregateWasMoved implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -73,6 +79,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php index 6db631b6430..a2f4bfed6d6 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php @@ -7,6 +7,9 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\NodeReferencing\Dto\SerializedNodeReferences; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -24,6 +27,9 @@ final readonly class NodeReferencesWereSet implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -52,6 +58,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php index e31b4202e69..849ca7dfb80 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php @@ -18,6 +18,9 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\NodeRemoval\Command\RemoveNodeAggregate; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -30,6 +33,9 @@ final readonly class NodeAggregateWasRemoved implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -53,6 +59,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new NodeAggregateWasRemoved( diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php index 743d33f3a2c..e0d41f99703 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php @@ -16,6 +16,9 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; @@ -28,6 +31,9 @@ final readonly class NodeAggregateNameWasChanged implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -48,6 +54,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php index eb20cb562fd..5c175c16b3e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php @@ -16,6 +16,9 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -28,6 +31,9 @@ final readonly class NodeAggregateTypeWasChanged implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -48,6 +54,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php index 1826a1045cf..e170cc81a83 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php @@ -18,6 +18,9 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -32,6 +35,9 @@ final readonly class NodeGeneralizationVariantWasCreated implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -54,6 +60,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new NodeGeneralizationVariantWasCreated( @@ -77,8 +88,8 @@ public static function fromArray(array $values): self array_key_exists('variantSucceedingSiblings', $values) ? InterdimensionalSiblings::fromArray($values['variantSucceedingSiblings']) : InterdimensionalSiblings::fromDimensionSpacePointSetWithoutSucceedingSiblings( - DimensionSpacePointSet::fromArray($values['generalizationCoverage']), - ), + DimensionSpacePointSet::fromArray($values['generalizationCoverage']), + ), ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php index 226e0c789a3..907acd81c9a 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php @@ -18,6 +18,9 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -30,6 +33,9 @@ final readonly class NodePeerVariantWasCreated implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -52,6 +58,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( @@ -75,8 +86,8 @@ public static function fromArray(array $values): self array_key_exists('peerSucceedingSiblings', $values) ? InterdimensionalSiblings::fromArray($values['peerSucceedingSiblings']) : InterdimensionalSiblings::fromDimensionSpacePointSetWithoutSucceedingSiblings( - DimensionSpacePointSet::fromArray($values['peerCoverage']), - ), + DimensionSpacePointSet::fromArray($values['peerCoverage']), + ), ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php index 0e757c8b88b..4416f712e13 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php @@ -18,6 +18,9 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -32,6 +35,9 @@ final readonly class NodeSpecializationVariantWasCreated implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -53,6 +59,12 @@ public function getNodeAggregateId(): NodeAggregateId { return $this->nodeAggregateId; } + + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( @@ -76,8 +88,8 @@ public static function fromArray(array $values): self array_key_exists('specializationSiblings', $values) ? InterdimensionalSiblings::fromArray($values['specializationSiblings']) : InterdimensionalSiblings::fromDimensionSpacePointSetWithoutSucceedingSiblings( - DimensionSpacePointSet::fromArray($values['specializationCoverage']) - ), + DimensionSpacePointSet::fromArray($values['specializationCoverage']) + ), ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php index e444a3232e0..a0b032f71eb 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php @@ -17,6 +17,9 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -31,6 +34,9 @@ final readonly class RootNodeAggregateDimensionsWereUpdated implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -52,6 +58,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php index 0ca33871bfd..092e6941c24 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php @@ -17,6 +17,9 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; @@ -32,6 +35,9 @@ final readonly class RootNodeAggregateWithNodeWasCreated implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -55,6 +61,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php index 224594af9cb..05b51621b80 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php @@ -17,6 +17,9 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -31,6 +34,9 @@ final readonly class SubtreeWasTagged implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { /** @@ -58,6 +64,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php index ad19ff68107..b6c739a1d2b 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php @@ -17,6 +17,9 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -32,6 +35,9 @@ final readonly class SubtreeWasUntagged implements EventInterface, PublishableToWorkspaceInterface, + EmbedsContentStreamId, + EmbedsNodeAggregateId, + EmbedsWorkspaceName, EmbedsContentStreamAndNodeAggregateId { /** @@ -59,6 +65,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Event/RootWorkspaceWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Event/RootWorkspaceWasCreated.php index 005c124d1d3..a1a5197d265 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Event/RootWorkspaceWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Event/RootWorkspaceWasCreated.php @@ -15,6 +15,8 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceCreation\Event; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\ContentStreamCreation\Event\ContentStreamWasCreated; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceDescription; @@ -29,7 +31,7 @@ * * @api events are the persistence-API of the content repository */ -final readonly class RootWorkspaceWasCreated implements EventInterface +final readonly class RootWorkspaceWasCreated implements EventInterface, EmbedsWorkspaceName { public function __construct( public WorkspaceName $workspaceName, @@ -39,6 +41,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Event/WorkspaceWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Event/WorkspaceWasCreated.php index d9fb086b4ed..8cefa918108 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Event/WorkspaceWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Event/WorkspaceWasCreated.php @@ -15,6 +15,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceCreation\Event; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\ContentStreamForking\Event\ContentStreamWasForked; use Neos\ContentRepository\Core\SharedModel\User\UserId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -30,7 +31,7 @@ * * @api events are the persistence-API of the content repository */ -final readonly class WorkspaceWasCreated implements EventInterface +final readonly class WorkspaceWasCreated implements EventInterface, EmbedsWorkspaceName { public function __construct( public WorkspaceName $workspaceName, @@ -42,6 +43,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceBaseWorkspaceWasChanged.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceBaseWorkspaceWasChanged.php index fb36757513f..89b4df3c1b2 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceBaseWorkspaceWasChanged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceBaseWorkspaceWasChanged.php @@ -5,6 +5,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceModification\Event; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -13,7 +14,7 @@ * * @api events are the persistence-API of the content repository */ -final readonly class WorkspaceBaseWorkspaceWasChanged implements EventInterface +final readonly class WorkspaceBaseWorkspaceWasChanged implements EventInterface, EmbedsWorkspaceName { public function __construct( public WorkspaceName $workspaceName, @@ -22,6 +23,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceOwnerWasChanged.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceOwnerWasChanged.php index 8fa89bb92be..3940cf1b91a 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceOwnerWasChanged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceOwnerWasChanged.php @@ -5,6 +5,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceModification\Event; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -13,7 +14,7 @@ * * @api events are the persistence-API of the content repository */ -final readonly class WorkspaceOwnerWasChanged implements EventInterface +final readonly class WorkspaceOwnerWasChanged implements EventInterface, EmbedsWorkspaceName { public function __construct( public WorkspaceName $workspaceName, @@ -21,6 +22,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceWasRemoved.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceWasRemoved.php index ce1a3f4b787..e7e80b98a27 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceWasRemoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceWasRemoved.php @@ -5,6 +5,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceModification\Event; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -12,13 +13,18 @@ * * @api events are the persistence-API of the content repository */ -final readonly class WorkspaceWasRemoved implements EventInterface +final readonly class WorkspaceWasRemoved implements EventInterface, EmbedsWorkspaceName { public function __construct( public WorkspaceName $workspaceName, ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceWasRenamed.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceWasRenamed.php index 6cf60bfcdcd..0eb3b0ea067 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceWasRenamed.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Event/WorkspaceWasRenamed.php @@ -5,6 +5,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceModification\Event; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceDescription; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceTitle; @@ -14,7 +15,7 @@ * * @api events are the persistence-API of the content repository */ -final readonly class WorkspaceWasRenamed implements EventInterface +final readonly class WorkspaceWasRenamed implements EventInterface, EmbedsWorkspaceName { public function __construct( public WorkspaceName $workspaceName, @@ -23,6 +24,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Event/WorkspaceWasDiscarded.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Event/WorkspaceWasDiscarded.php index 612661249c9..35b2a6bd321 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Event/WorkspaceWasDiscarded.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Event/WorkspaceWasDiscarded.php @@ -15,13 +15,14 @@ namespace Neos\ContentRepository\Core\Feature\WorkspacePublication\Event; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * @api events are the persistence-API of the content repository */ -final readonly class WorkspaceWasDiscarded implements EventInterface +final readonly class WorkspaceWasDiscarded implements EventInterface, EmbedsWorkspaceName { public function __construct( public WorkspaceName $workspaceName, @@ -36,6 +37,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Event/WorkspaceWasPartiallyDiscarded.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Event/WorkspaceWasPartiallyDiscarded.php index 427c197b547..d9d88cddfac 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Event/WorkspaceWasPartiallyDiscarded.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Event/WorkspaceWasPartiallyDiscarded.php @@ -15,6 +15,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspacePublication\Event; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdsToPublishOrDiscard; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -22,7 +23,7 @@ /** * @api events are the persistence-API of the content repository */ -final readonly class WorkspaceWasPartiallyDiscarded implements EventInterface +final readonly class WorkspaceWasPartiallyDiscarded implements EventInterface, EmbedsWorkspaceName { public function __construct( public WorkspaceName $workspaceName, @@ -38,6 +39,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/Event/WorkspaceRebaseFailed.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/Event/WorkspaceRebaseFailed.php index b725133b6a7..b0d4e200568 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/Event/WorkspaceRebaseFailed.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/Event/WorkspaceRebaseFailed.php @@ -15,6 +15,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceRebase\Event; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -23,7 +24,7 @@ * @deprecated this is no longer logged, instead an exception is thrown * @see Neos\ContentRepository\Core\Feature\WorkspaceRebase\Exception\WorkspaceRebaseFailed */ -final readonly class WorkspaceRebaseFailed implements EventInterface +final readonly class WorkspaceRebaseFailed implements EventInterface, EmbedsWorkspaceName { /** * @param array> $errors @@ -43,6 +44,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/Event/WorkspaceWasRebased.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/Event/WorkspaceWasRebased.php index df7ed200d60..263f9e418c6 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/Event/WorkspaceWasRebased.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/Event/WorkspaceWasRebased.php @@ -15,13 +15,14 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceRebase\Event; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * @api events are the persistence-API of the content repository */ -final readonly class WorkspaceWasRebased implements EventInterface +final readonly class WorkspaceWasRebased implements EventInterface, EmbedsWorkspaceName { public function __construct( public WorkspaceName $workspaceName, @@ -36,6 +37,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public static function fromArray(array $values): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentStream/ContentStreamProjection.php b/Neos.ContentRepository.Core/Classes/Projection/ContentStream/ContentStreamProjection.php index c3aa38c2434..debae65cb4a 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentStream/ContentStreamProjection.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentStream/ContentStreamProjection.php @@ -15,13 +15,12 @@ namespace Neos\ContentRepository\Core\Projection\ContentStream; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types; use Neos\ContentRepository\Core\EventStore\EventInterface; -use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; use Neos\ContentRepository\Core\Feature\ContentStreamClosing\Event\ContentStreamWasClosed; use Neos\ContentRepository\Core\Feature\ContentStreamClosing\Event\ContentStreamWasReopened; use Neos\ContentRepository\Core\Feature\ContentStreamCreation\Event\ContentStreamWasCreated; @@ -160,12 +159,12 @@ public function canHandle(EventInterface $event): bool ContentStreamWasRemoved::class, DimensionShineThroughWasAdded::class, ]) - || $event instanceof EmbedsContentStreamAndNodeAggregateId; + || $event instanceof EmbedsContentStreamId; } public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void { - if ($event instanceof EmbedsContentStreamAndNodeAggregateId) { + if ($event instanceof EmbedsContentStreamId) { $this->updateContentStreamVersion($event, $eventEnvelope); return; } @@ -379,7 +378,7 @@ private function updateStateForContentStream(ContentStreamId $contentStreamId, C } private function updateContentStreamVersion( - EmbedsContentStreamAndNodeAggregateId $eventInstance, + EmbedsContentStreamId $eventInstance, EventEnvelope $eventEnvelope ): void { $this->dbal->update($this->tableName, [ diff --git a/Neos.Neos/Classes/Fusion/Cache/GraphProjectorCatchUpHookForCacheFlushing.php b/Neos.Neos/Classes/Fusion/Cache/GraphProjectorCatchUpHookForCacheFlushing.php index c71a2965ca2..d550c48598e 100644 --- a/Neos.Neos/Classes/Fusion/Cache/GraphProjectorCatchUpHookForCacheFlushing.php +++ b/Neos.Neos/Classes/Fusion/Cache/GraphProjectorCatchUpHookForCacheFlushing.php @@ -14,7 +14,8 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\EventStore\EventInterface; -use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; use Neos\ContentRepository\Core\Feature\NodeMove\Event\NodeAggregateWasMoved; use Neos\ContentRepository\Core\Feature\NodeRemoval\Event\NodeAggregateWasRemoved; use Neos\ContentRepository\Core\Projection\CatchUpHookInterface; @@ -175,7 +176,8 @@ public function onAfterEvent(EventInterface $eventInstance, EventEnvelope $event if ( !($eventInstance instanceof NodeAggregateWasRemoved) - && $eventInstance instanceof EmbedsContentStreamAndNodeAggregateId + && $eventInstance instanceof EmbedsNodeAggregateId + && $eventInstance instanceof EmbedsContentStreamId ) { $workspace = $this->contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId($eventInstance->getContentStreamId()); if ($workspace === null) { From 5a90ebdc9c0a6e607d1f3f94588b022dfada45a6 Mon Sep 17 00:00:00 2001 From: Denny Lubitz Date: Wed, 28 Aug 2024 11:57:00 +0200 Subject: [PATCH 2/5] TASK: Split up EmbedsContentStreamAndNodeAggregateId interface into EmbedsContentStreamId and EmbedsNodeAggregateId and add EmbedsWorkspaceName interface --- .../NodeCreation/Event/NodeAggregateWithNodeWasCreated.php | 6 +++--- .../Event/NodeGeneralizationVariantWasCreated.php | 4 ++-- .../NodeVariation/Event/NodePeerVariantWasCreated.php | 4 ++-- .../Event/NodeSpecializationVariantWasCreated.php | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php index 5cec47b04f1..24f25165c8c 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php @@ -105,11 +105,11 @@ public static function fromArray(array $values): self array_key_exists('succeedingSiblingsForCoverage', $values) ? InterdimensionalSiblings::fromArray($values['succeedingSiblingsForCoverage']) : InterdimensionalSiblings::fromDimensionSpacePointSetWithSingleSucceedingSiblings( - DimensionSpacePointSet::fromArray($values['coveredDimensionSpacePoints']), - isset($values['succeedingNodeAggregateId']) + DimensionSpacePointSet::fromArray($values['coveredDimensionSpacePoints']), + isset($values['succeedingNodeAggregateId']) ? NodeAggregateId::fromString($values['succeedingNodeAggregateId']) : null, - ), + ), NodeAggregateId::fromString($values['parentNodeAggregateId']), isset($values['nodeName']) ? NodeName::fromString($values['nodeName']) : null, SerializedPropertyValues::fromArray($values['initialPropertyValues']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php index e170cc81a83..502218bcb95 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php @@ -88,8 +88,8 @@ public static function fromArray(array $values): self array_key_exists('variantSucceedingSiblings', $values) ? InterdimensionalSiblings::fromArray($values['variantSucceedingSiblings']) : InterdimensionalSiblings::fromDimensionSpacePointSetWithoutSucceedingSiblings( - DimensionSpacePointSet::fromArray($values['generalizationCoverage']), - ), + DimensionSpacePointSet::fromArray($values['generalizationCoverage']), + ), ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php index 907acd81c9a..3fb65d71f42 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php @@ -86,8 +86,8 @@ public static function fromArray(array $values): self array_key_exists('peerSucceedingSiblings', $values) ? InterdimensionalSiblings::fromArray($values['peerSucceedingSiblings']) : InterdimensionalSiblings::fromDimensionSpacePointSetWithoutSucceedingSiblings( - DimensionSpacePointSet::fromArray($values['peerCoverage']), - ), + DimensionSpacePointSet::fromArray($values['peerCoverage']), + ), ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php index 4416f712e13..05c7bcfcf03 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php @@ -88,8 +88,8 @@ public static function fromArray(array $values): self array_key_exists('specializationSiblings', $values) ? InterdimensionalSiblings::fromArray($values['specializationSiblings']) : InterdimensionalSiblings::fromDimensionSpacePointSetWithoutSucceedingSiblings( - DimensionSpacePointSet::fromArray($values['specializationCoverage']) - ), + DimensionSpacePointSet::fromArray($values['specializationCoverage']) + ), ); } From b218954a5795805826d241f3ae7c22019ee653cf Mon Sep 17 00:00:00 2001 From: Denny Lubitz Date: Wed, 28 Aug 2024 12:15:09 +0200 Subject: [PATCH 3/5] TASK: Split up EmbedsContentStreamAndNodeAggregateId interface into EmbedsContentStreamId and EmbedsNodeAggregateId and add EmbedsWorkspaceName interface --- .../Projection/ContentStream/ContentStreamProjection.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentStream/ContentStreamProjection.php b/Neos.ContentRepository.Core/Classes/Projection/ContentStream/ContentStreamProjection.php index debae65cb4a..a689d3f7cde 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentStream/ContentStreamProjection.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentStream/ContentStreamProjection.php @@ -166,7 +166,6 @@ public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void { if ($event instanceof EmbedsContentStreamId) { $this->updateContentStreamVersion($event, $eventEnvelope); - return; } match ($event::class) { ContentStreamWasCreated::class => $this->whenContentStreamWasCreated($event, $eventEnvelope), @@ -183,7 +182,7 @@ public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void ContentStreamWasReopened::class => $this->whenContentStreamWasReopened($event, $eventEnvelope), ContentStreamWasRemoved::class => $this->whenContentStreamWasRemoved($event, $eventEnvelope), DimensionShineThroughWasAdded::class => $this->whenDimensionShineThroughWasAdded($event, $eventEnvelope), - default => throw new \InvalidArgumentException(sprintf('Unsupported event %s', get_debug_type($event))), + default => $event instanceof EmbedsContentStreamId || throw new \InvalidArgumentException(sprintf('Unsupported event %s', get_debug_type($event))), }; } From 8c9e6c7802b55ff02650ac0abac173c3919b1ea2 Mon Sep 17 00:00:00 2001 From: Denny Lubitz Date: Fri, 30 Aug 2024 09:36:21 +0200 Subject: [PATCH 4/5] TASK: Remove EmbedsContentStreamAndNodeAggregateId interface --- .../EmbedsContentStreamAndNodeAggregateId.php | 27 ------------------- .../Event/NodeAggregateWithNodeWasCreated.php | 4 +-- .../Event/NodeAggregateWasDisabled.php | 4 +-- .../Event/NodeAggregateWasEnabled.php | 4 +-- .../Event/NodePropertiesWereSet.php | 4 +-- .../NodeMove/Event/NodeAggregateWasMoved.php | 4 +-- .../Event/NodeReferencesWereSet.php | 4 +-- .../Event/NodeAggregateWasRemoved.php | 4 +-- .../Event/NodeAggregateNameWasChanged.php | 4 +-- .../Event/NodeAggregateTypeWasChanged.php | 4 +-- .../NodeGeneralizationVariantWasCreated.php | 4 +-- .../Event/NodePeerVariantWasCreated.php | 4 +-- .../NodeSpecializationVariantWasCreated.php | 4 +-- ...RootNodeAggregateDimensionsWereUpdated.php | 4 +-- .../RootNodeAggregateWithNodeWasCreated.php | 4 +-- .../SubtreeTagging/Event/SubtreeWasTagged.php | 4 +-- .../Event/SubtreeWasUntagged.php | 4 +-- 17 files changed, 16 insertions(+), 75 deletions(-) delete mode 100644 Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php deleted file mode 100644 index 722cdddac5e..00000000000 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php +++ /dev/null @@ -1,27 +0,0 @@ - Date: Sun, 1 Sep 2024 15:05:06 +0200 Subject: [PATCH 5/5] TASK: Use EmbedsWorkspaceName interface --- .../Cache/GraphProjectorCatchUpHookForCacheFlushing.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Neos.Neos/Classes/Fusion/Cache/GraphProjectorCatchUpHookForCacheFlushing.php b/Neos.Neos/Classes/Fusion/Cache/GraphProjectorCatchUpHookForCacheFlushing.php index 0a24bfa2aad..5e1f95564af 100644 --- a/Neos.Neos/Classes/Fusion/Cache/GraphProjectorCatchUpHookForCacheFlushing.php +++ b/Neos.Neos/Classes/Fusion/Cache/GraphProjectorCatchUpHookForCacheFlushing.php @@ -18,6 +18,7 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamId; use Neos\ContentRepository\Core\Feature\Common\EmbedsNodeAggregateId; +use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated; use Neos\ContentRepository\Core\Feature\NodeModification\Event\NodePropertiesWereSet; use Neos\ContentRepository\Core\Feature\NodeMove\Event\NodeAggregateWasMoved; @@ -236,17 +237,16 @@ public function onAfterEvent(EventInterface $eventInstance, EventEnvelope $event !($eventInstance instanceof NodeAggregateWasRemoved) && $eventInstance instanceof EmbedsNodeAggregateId && $eventInstance instanceof EmbedsContentStreamId - // TODO: We need some interface to ensure workspaceName is present - && property_exists($eventInstance, 'workspaceName') + && $eventInstance instanceof EmbedsWorkspaceName ) { - $nodeAggregate = $this->contentRepository->getContentGraph($eventInstance->workspaceName)->findNodeAggregateById( + $nodeAggregate = $this->contentRepository->getContentGraph($eventInstance->getWorkspaceName())->findNodeAggregateById( $eventInstance->getNodeAggregateId() ); if ($nodeAggregate) { $this->scheduleCacheFlushJobForNodeAggregate( $this->contentRepository, - $eventInstance->workspaceName, + $eventInstance->getWorkspaceName(), $nodeAggregate ); }