Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Nov 8, 2024
1 parent 76a975d commit c920a47
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,16 @@ private function serializeCreateNodeAggregateWithNode(
),
$this->mapNodeReferencesToSerializedNodeReferences($command->references, $command->nodeTypeName)
);
if (!$command->tetheredDescendantNodeAggregateIds->isEmpty()) {
$lowLevelCommand = $lowLevelCommand->withTetheredDescendantNodeAggregateIds($command->tetheredDescendantNodeAggregateIds);
}

$descendantNodeAggregateIds = $command->tetheredDescendantNodeAggregateIds->completeForNodeOfType(
$command->nodeTypeName,
$this->nodeTypeManager
);

// Write the auto-created descendant node aggregate ids back to the command;
// so that when rebasing the command, it stays fully deterministic.
$lowLevelCommand = $lowLevelCommand->withTetheredDescendantNodeAggregateIds($descendantNodeAggregateIds);

if ($command->nodeName) {
$lowLevelCommand = $lowLevelCommand->withNodeName($command->nodeName);
}
Expand Down Expand Up @@ -182,16 +189,8 @@ private function handleCreateNodeAggregateWithNodeAndSerializedProperties(
$this->requireNodeTypeNotToDeclareTetheredChildNodeName($parentNodeAggregate->nodeTypeName, $command->nodeName);
}

$descendantNodeAggregateIds = $command->tetheredDescendantNodeAggregateIds->completeForNodeOfType(
$command->nodeTypeName,
$this->nodeTypeManager
);
// Write the auto-created descendant node aggregate ids back to the command;
// so that when rebasing the command, it stays fully deterministic.
$command = $command->withTetheredDescendantNodeAggregateIds($descendantNodeAggregateIds);

foreach (
$descendantNodeAggregateIds->getNodeAggregateIds() as $descendantNodeAggregateId
$command->tetheredDescendantNodeAggregateIds->getNodeAggregateIds() as $descendantNodeAggregateId
) {
$this->requireProjectedNodeAggregateToNotExist(
$contentGraph,
Expand All @@ -217,7 +216,7 @@ private function handleCreateNodeAggregateWithNodeAndSerializedProperties(
$nodeType,
$coveredDimensionSpacePoints,
$command->nodeAggregateId,
$descendantNodeAggregateIds,
$command->tetheredDescendantNodeAggregateIds,
null
)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ private function handleChangeNodeAggregateType(
$command->newNodeTypeName,
$this->nodeTypeManager
);
// todo
// Write the auto-created descendant node aggregate ids back to the command;
// so that when rebasing the command, it stays fully deterministic.
$command = $command->withTetheredDescendantNodeAggregateIds($descendantNodeAggregateIds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ private function handleCreateRootNodeAggregateWithNode(
$command->nodeTypeName,
$this->nodeTypeManager
);
// todo (and find other $command = $command things. ..
// Write the auto-created descendant node aggregate ids back to the command;
// so that when rebasing the command, it stays fully deterministic.
$command = $command->withTetheredDescendantNodeAggregateIds($descendantNodeAggregateIds);
Expand Down

0 comments on commit c920a47

Please sign in to comment.