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

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

fromArray(array $array)

No description

withTetheredDescendantNodeAggregateIds(NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds)

Specify explicitly the node aggregate ids for the tethered children {tetheredDescendantNodeAggregateIds}.

withNodeName(NodeName $nodeName) deprecated

The node's optional name.

withReferences(NodeReferencesToWrite $references)

Adds references to this creation command

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

Parameters

WorkspaceName $workspaceName

The workspace in which the create operation is to be performed

NodeAggregateId $nodeAggregateId

The unique identifier of the node aggregate to create

NodeTypeName $nodeTypeName

Name of the node type of the new node

OriginDimensionSpacePoint $originDimensionSpacePoint

Origin of the new node in the dimension space. Will also be used to calculate a set of dimension points where the new node will cover from the configured specializations.

NodeAggregateId $parentNodeAggregateId

The id of the node aggregate underneath which the new node is added

NodeAggregateId|null $succeedingSiblingNodeAggregateId

Node aggregate id of the node's succeeding sibling (optional). If not given, the node will be added as the parent's first child

PropertyValuesToWrite|null $initialPropertyValues

The node's initial property values. Will be merged over the node type's default property values

NodeReferencesToWrite|null $references

Initial references this node will have (optional). If not given, no references are created

Return Value

CreateNodeAggregateWithNode

static CommandInterface fromArray(array $array)

No description

Parameters

array $array

Return Value

CommandInterface

CreateNodeAggregateWithNode withInitialPropertyValues(PropertyValuesToWrite $newInitialPropertyValues)

No description

Parameters

PropertyValuesToWrite $newInitialPropertyValues

Return Value

CreateNodeAggregateWithNode

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.

Parameters

NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds

Return Value

CreateNodeAggregateWithNode

CreateNodeAggregateWithNode withNodeName(NodeName $nodeName) deprecated

deprecated the concept regarding node-names for non-tethered nodes is outdated.

The node's optional name.

Set if there is a meaningful relation to its parent that should be named.

Parameters

NodeName $nodeName

Return Value

CreateNodeAggregateWithNode

CreateNodeAggregateWithNode withReferences(NodeReferencesToWrite $references)

Adds references to this creation command

Parameters

NodeReferencesToWrite $references

Return Value

CreateNodeAggregateWithNode