NodeDuplicationService
final class NodeDuplicationService (View source)
Service to copy node recursively - as there is no equivalent content repository core command.
Methods
Copies the specified source node and its children to the target node
No description
Details
__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
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.
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