ContentSubgraphInterface
interface ContentSubgraphInterface (View source)
This is the most important read model of a content repository.
It is a "view" to the content graph, only showing a single dimension (e.g. "language=de,country=ch") - so this means this is effectively a tree of nodes.
Accessing the Content Subgraph
From the central Content Repository instance, you can fetch the singleton {\Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphInterface}. There, you can call {\Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphInterface::getSubgraph()} and pass in the {\Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint} and {\Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints} you want to have.
Why is this called "Subgraph" and not Tree?
This is because a tree can have only a single root node, but the ContentSubgraph supports multiple root nodes. So the totally correct term would be a "Forest", but this is unknown terminology outside academia. This is why we go for "Subgraph" to show that this is a part of the Content Graph.
Methods
No description
No description
No description
No description
Find a root node by its type Note that only one root node can exist per type as enforced by {RootNodeHandling}
Find direct child nodes of the specified parent node that match the given $filter
Count direct child nodes of the specified parent node that match the given $filter
Find the direct parent of a node specified by its aggregate id
Find all nodes that are positioned behind the specified sibling and match the specified $filter
Find all nodes that are positioned before the specified sibling and match the specified $filter
Recursively find all nodes above the $entryNodeAggregateId that match the specified $filter and return them as a flat list
Count all nodes above the $entryNodeAggregateId that match the specified $filter
Find the closest matching node, the entry node itself or the first ancestors of the $entryNodeAggregateId, that match the specified $filter and return it Note: in contrast to {findAncestorNodes()} the resulting node will be the entry node if it matches the filter!
Recursively find all nodes underneath the $entryNodeAggregateId that match the specified $filter and return them as a flat list
Count all nodes underneath the $entryNodeAggregateId that match the specified $filter
Recursively find all nodes underneath the $entryNodeAggregateId that match the specified $filter and return them as a tree
Find all "outgoing" references of a given node that match the specified $filter
Count all "outgoing" references of a given node that match the specified $filter
Find all "incoming" references of a given node that match the specified $filter If nodes "A" and "B" both have a reference to "C", the node "C" has two incoming references.
Count all "incoming" references of a given node that match the specified $filter
Find a single node underneath $startingNodeAggregateId that matches the specified $path
Find a single node underneath that matches the specified absolute $path
Count all nodes in this subgraph, including inaccessible ones!
Details
ContentRepositoryId
getContentRepositoryId()
No description
WorkspaceName
getWorkspaceName()
No description
DimensionSpacePoint
getDimensionSpacePoint()
No description
VisibilityConstraints
getVisibilityConstraints()
No description
Node|null
findNodeById(NodeAggregateId $nodeAggregateId)
Find a single node by its aggregate id
Nodes
findNodesByIds(NodeAggregateIds $nodeAggregateIds)
Find all nodes by the specified aggregate ids
Node|null
findRootNodeByType(NodeTypeName $nodeTypeName)
Find a root node by its type Note that only one root node can exist per type as enforced by {RootNodeHandling}
Nodes
findChildNodes(NodeAggregateId $parentNodeAggregateId, FindChildNodesFilter $filter)
Find direct child nodes of the specified parent node that match the given $filter
int
countChildNodes(NodeAggregateId $parentNodeAggregateId, CountChildNodesFilter $filter)
Count direct child nodes of the specified parent node that match the given $filter
Node|null
findParentNode(NodeAggregateId $childNodeAggregateId)
Find the direct parent of a node specified by its aggregate id
Nodes
findSucceedingSiblingNodes(NodeAggregateId $siblingNodeAggregateId, FindSucceedingSiblingNodesFilter $filter)
Find all nodes that are positioned behind the specified sibling and match the specified $filter
Nodes
findPrecedingSiblingNodes(NodeAggregateId $siblingNodeAggregateId, FindPrecedingSiblingNodesFilter $filter)
Find all nodes that are positioned before the specified sibling and match the specified $filter
Nodes
findAncestorNodes(NodeAggregateId $entryNodeAggregateId, FindAncestorNodesFilter $filter)
Recursively find all nodes above the $entryNodeAggregateId that match the specified $filter and return them as a flat list
int
countAncestorNodes(NodeAggregateId $entryNodeAggregateId, CountAncestorNodesFilter $filter)
Count all nodes above the $entryNodeAggregateId that match the specified $filter
Node|null
findClosestNode(NodeAggregateId $entryNodeAggregateId, FindClosestNodeFilter $filter)
Find the closest matching node, the entry node itself or the first ancestors of the $entryNodeAggregateId, that match the specified $filter and return it Note: in contrast to {findAncestorNodes()} the resulting node will be the entry node if it matches the filter!
Nodes
findDescendantNodes(NodeAggregateId $entryNodeAggregateId, FindDescendantNodesFilter $filter)
Recursively find all nodes underneath the $entryNodeAggregateId that match the specified $filter and return them as a flat list
Note: This is basically a set-based view of descendant nodes; so the ordering should not be relied upon
int
countDescendantNodes(NodeAggregateId $entryNodeAggregateId, CountDescendantNodesFilter $filter)
Count all nodes underneath the $entryNodeAggregateId that match the specified $filter
Subtree|null
findSubtree(NodeAggregateId $entryNodeAggregateId, FindSubtreeFilter $filter)
Recursively find all nodes underneath the $entryNodeAggregateId that match the specified $filter and return them as a tree
Note: This returns a fragment of the existing tree structure. The structure is kept intact but nodes might be missing depending on the specified filter
References
findReferences(NodeAggregateId $nodeAggregateId, FindReferencesFilter $filter)
Find all "outgoing" references of a given node that match the specified $filter
Because each reference has a name and can contain properties itself, this method does not return the target nodes directly, but a collection of references {\Neos\ContentRepository\Core\Projection\ContentGraph\References}. The corresponding nodes can be retrieved via {\Neos\ContentRepository\Core\Projection\ContentGraph\References::getNodes()}
int
countReferences(NodeAggregateId $nodeAggregateId, CountReferencesFilter $filter)
Count all "outgoing" references of a given node that match the specified $filter
References
findBackReferences(NodeAggregateId $nodeAggregateId, FindBackReferencesFilter $filter)
Find all "incoming" references of a given node that match the specified $filter If nodes "A" and "B" both have a reference to "C", the node "C" has two incoming references.
int
countBackReferences(NodeAggregateId $nodeAggregateId, CountBackReferencesFilter $filter)
Count all "incoming" references of a given node that match the specified $filter
Node|null
findNodeByPath(NodePath|NodeName $path, NodeAggregateId $startingNodeAggregateId)
Find a single node underneath $startingNodeAggregateId that matches the specified $path
If a node name as $path is given it will be treated as path with a single segment.
NOTE: This operation is most likely to be deprecated since the concept of node paths is not really used in the core, and it has some logical issues
Node|null
findNodeByAbsolutePath(AbsoluteNodePath $path)
Find a single node underneath that matches the specified absolute $path
NOTE: This operation is most likely to be deprecated since the concept of node paths is not really used in the core, and it has some logical issues
AbsoluteNodePath
retrieveNodePath(NodeAggregateId $nodeAggregateId)
deprecated
deprecated
Determine the absolute path of a node
int
countNodes()
| internal | this method might change without further notice. |
Count all nodes in this subgraph, including inaccessible ones!