CreateNodeAggregateWithNode
final class CreateNodeAggregateWithNode implements CommandInterface (View source)
Creates a new node aggregate with a new node.
The node will be appended as child node of the given parentNodeId which must cover the given
originDimensionSpacePoint.
Methods
No description
No description
Specify explicitly the node aggregate ids for the tethered children {tetheredDescendantNodeAggregateIds}.
Details
static CreateNodeAggregateWithNode
create(WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeTypeName $nodeTypeName, OriginDimensionSpacePoint $originDimensionSpacePoint, NodeAggregateId $parentNodeAggregateId, NodeAggregateId|null $succeedingSiblingNodeAggregateId = null, PropertyValuesToWrite|null $initialPropertyValues = null, NodeReferencesToWrite|null $references = null)
No description
static CommandInterface
fromArray(array $array)
No description
CreateNodeAggregateWithNode
withInitialPropertyValues(PropertyValuesToWrite $newInitialPropertyValues)
No description
CreateNodeAggregateWithNode
withTetheredDescendantNodeAggregateIds(NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds)
Specify explicitly the node aggregate ids for the tethered children {tetheredDescendantNodeAggregateIds}.
In case you want to create a batch of commands where one creates the node and a succeeding command needs a tethered node aggregate id, you need to generate the child node aggregate ids in advance.
Alternatively you would need to fetch the created tethered node first from the subgraph. {[\Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface::findNodeByPath()}
The](../../../../../../Neos/ContentRepository/Core/Projection/ContentGraph/ContentSubgraphInterface.html) helper method {\Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths::createForNodeType()} will generate recursively node aggregate ids for every tethered child node:
$tetheredDescendantNodeAggregateIds = NodeAggregateIdsByNodePaths::createForNodeType(
$command->nodeTypeName,
$nodeTypeManager
);
$command = $command->withTetheredDescendantNodeAggregateIds($tetheredDescendantNodeAggregateIds):
The generated node aggregate id for the tethered node "main" is this way known before the command is issued:
$mainNodeAggregateId = $command->tetheredDescendantNodeAggregateIds->getNodeAggregateId(NodePath::fromString('main'));
Generating the node aggregate ids from user land is totally optional.
CreateNodeAggregateWithNode
withNodeName(NodeName $nodeName)
deprecated
deprecated
The node's optional name.
Set if there is a meaningful relation to its parent that should be named.
CreateNodeAggregateWithNode
withReferences(NodeReferencesToWrite $references)
Adds references to this creation command