final class AbsoluteNodePath implements JsonSerializable (View source)

An absolute node path, composed of the root node's type and a relative path from there.

Example: root path: '/' results in ~ {"rootNodeTypeName": "Neos.ContentRepository:Root", "path": []} non-root path: '//my-site/main' results in ~ {"rootNodeTypeName": "Neos.ContentRepository:Root", "path": ["my-site", "main"]}

It describes the hierarchy path of a node to and including its root node in a subgraph.

To fetch a node via an absolute path use the subgraph: {[\Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface::findNodeByAbsolutePath()}

$subgraph->findNodeByAbsolutePath(
](../../../../../Neos/ContentRepository/Core/Projection/ContentGraph/ContentSubgraphInterface.html)    AbsoluteNodePath::fromString("/<Neos.Neos:Sites>/my-site/main")
)

Methods

fromRootNodeTypeNameAndRelativePath(NodeTypeName $rootNodeTypeName, NodePath $path)

No description

fromLeafNodeAndAncestors(Node $leafNode, Nodes $ancestors)

The ancestors must be ordered with the root node first.

static bool
patternIsMatchedByString(string $value)

No description

fromString(string $value)

No description

static AbsoluteNodePath|null
tryFromString(string $string)

No description

appendPathSegment(NodeName $nodeName)

No description

bool
isRoot()

While all absolute node paths have a root node type name, they are root only if they point to exactly that root node and not one of its descendants

array
getParts()

No description

int
getDepth()

No description

bool
equals(AbsoluteNodePath $other)

No description

string
serializeToString()

No description

string
jsonSerialize()

No description

string
__toString()

No description

Details

static AbsoluteNodePath fromRootNodeTypeNameAndRelativePath(NodeTypeName $rootNodeTypeName, NodePath $path)

No description

Parameters

NodeTypeName $rootNodeTypeName
NodePath $path

Return Value

AbsoluteNodePath

static AbsoluteNodePath fromLeafNodeAndAncestors(Node $leafNode, Nodes $ancestors)

The ancestors must be ordered with the root node first.

If you want to retrieve the path of a node using {\Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface::findAncestorNodes()}, you need to reverse the order first {[\Neos\ContentRepository\Core\Projection\ContentGraph\Nodes::reverse()}

$ancestors](../../../../../Neos/ContentRepository/Core/Projection/ContentGraph/Nodes.html) = $this->findAncestorNodes($leafNode->nodeAggregateId, FindAncestorNodesFilter::create())->reverse();
$absoluteNodePath = AbsoluteNodePath::fromLeafNodeAndAncestors($leafNode, $ancestors);

Parameters

Node $leafNode
Nodes $ancestors

Return Value

AbsoluteNodePath

static bool patternIsMatchedByString(string $value)

No description

Parameters

string $value

Return Value

bool

static AbsoluteNodePath fromString(string $value)

No description

Parameters

string $value

Return Value

AbsoluteNodePath

static AbsoluteNodePath|null tryFromString(string $string)

No description

Parameters

string $string

Return Value

AbsoluteNodePath|null

AbsoluteNodePath appendPathSegment(NodeName $nodeName)

No description

Parameters

NodeName $nodeName

Return Value

AbsoluteNodePath

bool isRoot()

While all absolute node paths have a root node type name, they are root only if they point to exactly that root node and not one of its descendants

Return Value

bool

array getParts()

No description

Return Value

array

int getDepth()

No description

Return Value

int

bool equals(AbsoluteNodePath $other)

No description

Parameters

AbsoluteNodePath $other

Return Value

bool

string serializeToString()

No description

Return Value

string

string jsonSerialize()

No description

Return Value

string

string __toString()

No description

Return Value

string