NodeAggregateCommandHandler
final class NodeAggregateCommandHandler implements CommandHandlerInterface (View source)
| internal | from userland, you'll use ContentRepository::handle to dispatch commands |
Traits
Methods
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
This is the remediation action for non-existing tethered nodes.
No description
No description
No description
"simple" command handlers return EventsToPublish directly
Use this closure to run code with the Ancestor Node Type Checks disabled; e.g.
Details
protected NodeTypeManager
getNodeTypeManager()
No description
protected DimensionSpacePointSet
getAllowedDimensionSubspace()
No description
protected ContentStreamId
requireContentStream(WorkspaceName $workspaceName, CommandHandlingDependencies $commandHandlingDependencies)
No description
protected void
requireDimensionSpacePointToExist(DimensionSpacePoint $dimensionSpacePoint)
No description
protected NodeType
requireNodeType(NodeTypeName $nodeTypeName)
No description
protected void
requireNodeTypeToNotBeAbstract(NodeType $nodeType)
No description
protected void
requireNodeTypeToBeOfTypeRoot(NodeType $nodeType)
No description
protected void
requireNodeTypeToNotBeOfTypeRoot(NodeType $nodeType)
No description
protected void
requireRootNodeTypeToBeUnoccupied(ContentGraphInterface $contentGraph, NodeTypeName $nodeTypeName)
No description
protected void
requireTetheredDescendantNodeTypesToExist(NodeType $nodeType)
No description
protected void
requireTetheredDescendantNodeTypesToNotBeOfTypeRoot(NodeType $nodeType)
No description
protected void
requireExistingDeclaredTetheredDescendantsToBeTethered(ContentGraphInterface $contentGraph, NodeAggregate $nodeAggregate, NodeType $nodeType)
No description
protected void
requireNodeTypeToDeclareProperty(NodeTypeName $nodeTypeName, PropertyName $propertyName)
No description
protected void
requireNodeTypeToDeclareReference(NodeTypeName $nodeTypeName, ReferenceName $referenceName)
No description
protected void
requireNodeTypeNotToDeclareTetheredChildNodeName(NodeTypeName $nodeTypeName, NodeName $nodeName)
No description
protected void
requireNodeTypeToAllowNodesOfTypeInReference(NodeTypeName $nodeTypeName, ReferenceName $referenceName, NodeTypeName $nodeTypeNameInQuestion)
No description
protected void
requireNodeTypeToAllowNumberOfReferencesInReference(SerializedNodeReferences $nodeReferences, NodeTypeName $nodeTypeName)
No description
protected void
requireConstraintsImposedByAncestorsAreMet(ContentGraphInterface $contentGraph, NodeType $nodeType, array $parentNodeAggregateIds)
No description
protected void
requireNodeTypeConstraintsImposedByParentToBeMet(NodeType $parentsNodeType, NodeType $nodeType)
No description
protected bool
areNodeTypeConstraintsImposedByParentValid(NodeType $parentsNodeType, NodeType $nodeType)
No description
protected void
requireNodeTypeConstraintsImposedByGrandparentToBeMet(NodeType $grandParentsNodeType, NodeName|null $parentNodeName, NodeType $nodeType)
No description
protected bool
areNodeTypeConstraintsImposedByGrandparentValid(NodeType $grandParentsNodeType, NodeName|null $parentNodeName, NodeType $nodeType)
No description
protected NodeAggregate
requireProjectedNodeAggregate(ContentGraphInterface $contentGraph, NodeAggregateId $nodeAggregateId)
No description
protected void
requireProjectedNodeAggregateToNotExist(ContentGraphInterface $contentGraph, NodeAggregateId $nodeAggregateId)
No description
NodeAggregate
requireProjectedParentNodeAggregate(ContentGraphInterface $contentGraph, NodeAggregateId $childNodeAggregateId, OriginDimensionSpacePoint $childOriginDimensionSpacePoint)
No description
protected void
requireNodeAggregateToCoverDimensionSpacePoint(NodeAggregate $nodeAggregate, DimensionSpacePoint $dimensionSpacePoint)
No description
protected void
requireNodeAggregateToCoverDimensionSpacePoints(NodeAggregate $nodeAggregate, DimensionSpacePointSet $dimensionSpacePointSet)
No description
protected void
requireNodeAggregateToNotBeRoot(NodeAggregate $nodeAggregate, string|null $extraReason = '.')
No description
protected void
requireNodeAggregateToBeUntethered(NodeAggregate $nodeAggregate)
No description
protected void
requireNodeAggregateToNotBeDescendant(ContentGraphInterface $contentGraph, NodeAggregate $nodeAggregate, NodeAggregate $referenceNodeAggregate)
No description
protected void
requireNodeAggregateToBeSibling(ContentGraphInterface $contentGraph, NodeAggregateId $referenceNodeAggregateId, NodeAggregateId $siblingNodeAggregateId, DimensionSpacePoint $dimensionSpacePoint)
No description
protected void
requireNodeAggregateToBeChild(ContentGraphInterface $contentGraph, NodeAggregateId $childNodeAggregateId, NodeAggregateId $parentNodeAggregateId, DimensionSpacePoint $dimensionSpacePoint)
No description
protected void
requireNodeNameToBeUncovered(ContentGraphInterface $contentGraph, NodeName|null $nodeName, NodeAggregateId $parentNodeAggregateId, NodeAggregateId|null $exclusivelyAllowedNodeAggregateId = null)
No description
protected void
requireNodeAggregateToOccupyDimensionSpacePoint(NodeAggregate $nodeAggregate, OriginDimensionSpacePoint $originDimensionSpacePoint)
No description
protected void
requireNodeAggregateToNotOccupyDimensionSpacePoint(NodeAggregate $nodeAggregate, OriginDimensionSpacePoint $originDimensionSpacePoint)
No description
protected void
validateReferenceProperties(ReferenceName $referenceName, PropertyValuesToWrite $referenceProperties, NodeTypeName $nodeTypeName)
No description
protected ExpectedVersion
getExpectedVersionOfContentStream(ContentStreamId $contentStreamId, CommandHandlingDependencies $commandHandlingDependencies)
No description
protected void
requireDescendantNodesToNotFallbackToDimensionSpacePointsOtherThan(NodeAggregateId $nodeAggregateId, ContentGraphInterface $contentGraph, DimensionSpacePointsWithAllowedSpecializations $fallbackConstraints)
No description
PropertyConverter
getPropertyConverter()
No description
protected InterDimensionalVariationGraph
getInterDimensionalVariationGraph()
No description
protected bool
areAncestorNodeTypeConstraintChecksEnabled()
No description
EventsToPublish
handleUntagSubtree(UntagSubtree $command, CommandHandlingDependencies $commandHandlingDependencies)
No description
protected void
requireNodeAggregateNotToBeTethered(NodeAggregate $nodeAggregate)
No description
protected Events
createEventsForVariations(ContentGraphInterface $contentGraph, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, NodeAggregate $nodeAggregate)
No description
protected Events
handleCreateNodeSpecializationVariant(ContentGraphInterface $contentGraph, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, NodeAggregate $nodeAggregate)
No description
protected array
collectNodeSpecializationVariantsThatWillHaveBeenCreated(ContentGraphInterface $contentGraph, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, NodeAggregate $nodeAggregate, DimensionSpacePointSet $specializationVisibility, array $events)
No description
protected Events
handleCreateNodeGeneralizationVariant(ContentGraphInterface $contentGraph, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, NodeAggregate $nodeAggregate)
No description
protected array
collectNodeGeneralizationVariantsThatWillHaveBeenCreated(ContentGraphInterface $contentGraph, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, NodeAggregate $nodeAggregate, DimensionSpacePointSet $generalizationVisibility, array $events)
No description
protected Events
handleCreateNodePeerVariant(ContentGraphInterface $contentGraph, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, NodeAggregate $nodeAggregate)
No description
protected array
collectNodePeerVariantsThatWillHaveBeenCreated(ContentGraphInterface $contentGraph, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, NodeAggregate $nodeAggregate, DimensionSpacePointSet $peerVisibility, array $events)
No description
protected Events
createEventsForMissingTetheredNode(ContentGraphInterface $contentGraph, NodeAggregateId $parentNodeAggregateId, NodeTypeName $parentNodeTypeName, DimensionSpacePointSet $parentNodeAggregateCoverageByOccupant, OriginDimensionSpacePoint $originDimensionSpacePoint, TetheredNodeTypeDefinition $tetheredNodeTypeDefinition, NodeAggregateId|null $tetheredNodeAggregateId)
This is the remediation action for non-existing tethered nodes.
It handles two cases:
- there is no tethered node IN ANY DimensionSpacePoint -> we can simply create it
- there is a tethered node already in some DimensionSpacePoint -> we need to specialize/generalize/... the other Tethered Node.
protected array
createEventsForMissingTetheredNodeAggregate(ContentGraphInterface $contentGraph, TetheredNodeTypeDefinition $tetheredNodeTypeDefinition, OriginDimensionSpacePointSet $affectedOriginDimensionSpacePoints, CoverageByOrigin $coverageByOrigin, NodeAggregateId $parentNodeAggregateId, NodeAggregateId|null $succeedingSiblingNodeAggregateId, NodeAggregateIdsByNodePaths $nodeAggregateIdsByNodePaths, NodePath $currentNodePath)
No description
protected Events
createEventsForWronglyTypedNodeAggregate(ContentGraphInterface $contentGraph, NodeAggregate $nodeAggregate, NodeTypeName $newNodeTypeName, NodeAggregateIdsByNodePaths $nodeAggregateIdsByNodePaths, NodePath $currentNodePath, NodeAggregateTypeChangeChildConstraintConflictResolutionStrategy $conflictResolutionStrategy, NodeAggregateIds $alreadyRemovedNodeAggregateIds)
No description
__construct(NodeTypeManager $nodeTypeManager, ContentDimensionZookeeper $contentDimensionZookeeper, InterDimensionalVariationGraph $interDimensionalVariationGraph, PropertyConverter $propertyConverter)
No description
bool
canHandle(CommandInterface|RebasableToOtherWorkspaceInterface $command)
No description
EventsToPublish|Generator
handle(CommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies)
"simple" command handlers return EventsToPublish directly
For the case of the workspace command handler that need to publish to many streams and "close" the content-stream directly, it's allowed to yield the events to interact with the control flow of event publishing.
void
withoutAncestorNodeTypeConstraintChecks(Closure $callback)
Use this closure to run code with the Ancestor Node Type Checks disabled; e.g.
during imports.
You can disable this because many old sites have this constraint violated more or less; and it's easy to fix later on; as it does not touch the fundamental integrity of the CR.