final class NodeDuplicationService (View source)

Service to copy node recursively - as there is no equivalent content repository core command.

Methods

__construct(ContentRepositoryRegistry $contentRepositoryRegistry)

No description

void
copyNodesRecursively(ContentRepositoryId $contentRepositoryId, WorkspaceName $workspaceName, DimensionSpacePoint $sourceDimensionSpacePoint, NodeAggregateId $sourceNodeAggregateId, OriginDimensionSpacePoint $targetDimensionSpacePoint, NodeAggregateId $targetParentNodeAggregateId, NodeAggregateId|null $targetSucceedingSiblingNodeAggregateId, NodeAggregateIdMapping|null $nodeAggregateIdMapping = null)

Copies the specified source node and its children to the target node

calculateCopyNodesRecursively(Subtree $subtreeToCopy, ContentSubgraphInterface $subgraph, WorkspaceName $targetWorkspaceName, OriginDimensionSpacePoint $targetDimensionSpacePoint, NodeAggregateId $targetParentNodeAggregateId, NodeAggregateId|null $targetSucceedingSiblingNodeAggregateId, NodeAggregateIdMapping|null $nodeAggregateIdMapping = null)

No description

Details

__construct(ContentRepositoryRegistry $contentRepositoryRegistry)

No description

Parameters

ContentRepositoryRegistry $contentRepositoryRegistry

void copyNodesRecursively(ContentRepositoryId $contentRepositoryId, WorkspaceName $workspaceName, DimensionSpacePoint $sourceDimensionSpacePoint, NodeAggregateId $sourceNodeAggregateId, OriginDimensionSpacePoint $targetDimensionSpacePoint, NodeAggregateId $targetParentNodeAggregateId, NodeAggregateId|null $targetSucceedingSiblingNodeAggregateId, NodeAggregateIdMapping|null $nodeAggregateIdMapping = null)

Copies the specified source node and its children to the target node

Note about dimensions:

Currently the copying is primitive as that we take the read-model of the dimension to copy (the subgraph). and paste that into the target dimension. That means that the copy does not alter other dimensions and that virtual variants are materialised. For more information see https://github.com/neos/neos-development-collection/issues/5054

Note about constraints:

As we cannot rely on the full integrate on the subgraph regarding the current node type schema it might not be possible to copy a node and its children. For example copying a node with tethered children that is not tethered according to the current node type schema, or copying properties that are not defined in the current node type schema anymore. In those cases the structure adjustments have to be executed. (todo only copy what is applicable and be graceful)

Note about partial copy on error:

As the above mentioned constraints can fail and we handle the determined content repository commands one by one, a failure will lead to a partially evaluated copy. The content repository is still consistent but the intent is only partially fulfilled.

Parameters

ContentRepositoryId $contentRepositoryId

The content repository the copy operation is performed in

WorkspaceName $workspaceName

The name of the workspace where the node is copied and from and into (todo permit cross workspace copying?)

DimensionSpacePoint $sourceDimensionSpacePoint

The dimension to copy from

NodeAggregateId $sourceNodeAggregateId

The node aggregate which to copy (including its children)

OriginDimensionSpacePoint $targetDimensionSpacePoint

the dimension space point which is the target of the copy

NodeAggregateId $targetParentNodeAggregateId

Node aggregate id of the target node's parent. If not given, the node will be added as the parent's first child

NodeAggregateId|null $targetSucceedingSiblingNodeAggregateId

Node aggregate id of the target node's succeeding sibling (optional)

NodeAggregateIdMapping|null $nodeAggregateIdMapping

An assignment of "old" to "new" NodeAggregateIds

Return Value

void

Commands calculateCopyNodesRecursively(Subtree $subtreeToCopy, ContentSubgraphInterface $subgraph, WorkspaceName $targetWorkspaceName, OriginDimensionSpacePoint $targetDimensionSpacePoint, NodeAggregateId $targetParentNodeAggregateId, NodeAggregateId|null $targetSucceedingSiblingNodeAggregateId, NodeAggregateIdMapping|null $nodeAggregateIdMapping = null)

internal  implementation detail of {@see \Neos\Neos\Domain\Service\NodeDuplicationService::copyNodesRecursively}, exposed for EXPERIMENTAL use cases, the API can change any time!
 

No description

Parameters

Subtree $subtreeToCopy
ContentSubgraphInterface $subgraph
WorkspaceName $targetWorkspaceName
OriginDimensionSpacePoint $targetDimensionSpacePoint
NodeAggregateId $targetParentNodeAggregateId
NodeAggregateId|null $targetSucceedingSiblingNodeAggregateId
NodeAggregateIdMapping|null $nodeAggregateIdMapping

Return Value

Commands