NodeAggregate
final class NodeAggregate (View source)
Node aggregate read model. Returned mainly from {ContentGraphInterface}.
A Node Aggregate is the set of all nodes across different dimensions which belong to each other; i.e. which represent the same "thing" (the same Page, the same Text node, the same Product).
The system guarantees the following invariants:
- Inside a NodeAggregate, each DimensionSpacePoint has at most one Node which covers it. To check this, this class is used (mainly in constraint checks).
- The NodeType is always the same for all Nodes in a NodeAggregate
- all Nodes inside the NodeAggregate always have the same NodeName.
- all nodes inside a NodeAggregate are all of the same classification, which can be:
- root: for root nodes
- tethered: for nodes "attached" to the parent node (i.e. the old "AutoCreatedChildNodes")
- regular: for all other nodes.
Methods
No description
Returns the node for the occupied dimension space point.
Get the dimension space points this node aggregate is tagged according to the provided tag
Returns the nodes belonging to this aggregate, i.e. the "real materialized" node rows.
Details
static NodeAggregate
create(ContentRepositoryId $contentRepositoryId, WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeAggregateClassification $classification, NodeTypeName $nodeTypeName, NodeName|null $nodeName, OriginDimensionSpacePointSet $occupiedDimensionSpacePoints, array $nodesByOccupiedDimensionSpacePoint, CoverageByOrigin $coverageByOccupant, DimensionSpacePointSet $coveredDimensionSpacePoints, OriginByCoverage $occupationByCovered, array $nodeTagsByCoveredDimensionSpacePoint)
| internal | The signature of this method can change in the future! |
No description
bool
occupiesDimensionSpacePoint(OriginDimensionSpacePoint $originDimensionSpacePoint)
No description
Node
getNodeByOccupiedDimensionSpacePoint(OriginDimensionSpacePoint $occupiedDimensionSpacePoint)
Returns the node for the occupied dimension space point.
The node aggregate does only know about nodes from dimensions where they originate in. Fallback nodes are not part of the node aggregate as there is currently no use-case.
To fetch the occupying node by covered dimension space point use {\Neos\ContentRepository\Core\Projection\ContentGraph\self::getOccupationByCovered}:
$node = $this->getNodeByOccupiedDimensionSpacePoint(
$this->getOccupationByCovered($coveredDimensionSpacePoint)
);
bool
coversDimensionSpacePoint(DimensionSpacePoint $dimensionSpacePoint)
No description
DimensionSpacePointSet
getCoverageByOccupant(OriginDimensionSpacePoint $occupiedDimensionSpacePoint)
No description
OriginDimensionSpacePoint
getOccupationByCovered(DimensionSpacePoint $coveredDimensionSpacePoint)
No description
DimensionSpacePointSet
getCoveredDimensionsTaggedBy(SubtreeTag $subtreeTag, bool $withoutInherited)
| internal | Experimental api, this is a low level concept that is mostly not meant to be used outside the core or tests |
Get the dimension space points this node aggregate is tagged according to the provided tag
Implementation note:
We need to pass ${$nodeTagsByCoveredDimensionSpacePoint} additionally to the NodeAggregate as this information doesn't exist otherwise. The node aggregate only knows about its occupying nodes {$nodesByOccupiedDimensionSpacePoint} - so no fallbacks. This means we CANNOT substitute this implementation by iterating over the occupied nodes as explicitly tagged specialisations will not show up as tagged.
We could simplify this logic if we also add these specialisation node rows explicitly to the NodeAggregate, but currently there is no use for that.
iterable
getNodes()
| internal | Using this method to access all occupied nodes or possibly extract a single arbitrary node is not intended for use outside the core. |
Returns the nodes belonging to this aggregate, i.e. the "real materialized" node rows.