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

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)

No description

bool
occupiesDimensionSpacePoint(OriginDimensionSpacePoint $originDimensionSpacePoint)

No description

getNodeByOccupiedDimensionSpacePoint(OriginDimensionSpacePoint $occupiedDimensionSpacePoint)

Returns the node for the occupied dimension space point.

bool
coversDimensionSpacePoint(DimensionSpacePoint $dimensionSpacePoint)

No description

getCoverageByOccupant(OriginDimensionSpacePoint $occupiedDimensionSpacePoint)

No description

getOccupationByCovered(DimensionSpacePoint $coveredDimensionSpacePoint)

No description

getCoveredDimensionsTaggedBy(SubtreeTag $subtreeTag, bool $withoutInherited)

Get the dimension space points this node aggregate is tagged according to the provided tag

iterable
getNodes()

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

Parameters

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

Return Value

NodeAggregate

bool occupiesDimensionSpacePoint(OriginDimensionSpacePoint $originDimensionSpacePoint)

No description

Parameters

OriginDimensionSpacePoint $originDimensionSpacePoint

Return Value

bool

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)
);

Parameters

OriginDimensionSpacePoint $occupiedDimensionSpacePoint

Return Value

Node

bool coversDimensionSpacePoint(DimensionSpacePoint $dimensionSpacePoint)

No description

Parameters

DimensionSpacePoint $dimensionSpacePoint

Return Value

bool

DimensionSpacePointSet getCoverageByOccupant(OriginDimensionSpacePoint $occupiedDimensionSpacePoint)

No description

Parameters

OriginDimensionSpacePoint $occupiedDimensionSpacePoint

Return Value

DimensionSpacePointSet

OriginDimensionSpacePoint getOccupationByCovered(DimensionSpacePoint $coveredDimensionSpacePoint)

No description

Parameters

DimensionSpacePoint $coveredDimensionSpacePoint

Return Value

OriginDimensionSpacePoint

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.

Parameters

SubtreeTag $subtreeTag
bool $withoutInherited

only dimensions where the subtree tag was set explicitly will be returned, taking inheritance out of account {\Neos\ContentRepository\Core\Projection\ContentGraph\NodeTags::withoutInherited()}

Return Value

DimensionSpacePointSet

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.

Return Value

iterable