final class NodePath implements JsonSerializable (View source)

The relative node path is a collection of node names {NodeName}.

If it contains no elements, it is considered root in combination with {\Neos\ContentRepository\Core\Projection\ContentGraph\AbsoluteNodePath}.

Example: root path: '' is resolved to [] non-root path: 'my-document/main' is resolved to ~ ['my-document', 'main']

It describes the hierarchy path of a node to an ancestor node in a subgraph.

To fetch a node on a path use the subgraph: {[\Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface::findNodeByPath()}

$subgraph->findNodeByPath(
](../../../../../Neos/ContentRepository/Core/Projection/ContentGraph/ContentSubgraphInterface.html)    NodePath::fromString("my-document/main"),
    $siteNodeAggregateId
)

Methods

static NodePath
createEmpty()

No description

static NodePath
fromString(string $path)

No description

static NodePath
fromPathSegments(array $pathSegments)

No description

static NodePath
fromNodeNames(NodeName ...$nodeNames)

No description

bool
isEmpty()

No description

appendPathSegment(NodeName $nodeName)

IMMUTABLE function to create a new NodePath by appending a path segment. Returns a NEW NodePath object

array
getParts()

No description

int
getLength()

No description

bool
equals(NodePath $other)

No description

string
serializeToString()

No description

string
jsonSerialize()

No description

string
__toString()

No description

Details

static NodePath createEmpty()

No description

Return Value

NodePath

static NodePath fromString(string $path)

No description

Parameters

string $path

Return Value

NodePath

static NodePath fromPathSegments(array $pathSegments)

No description

Parameters

array $pathSegments

Return Value

NodePath

static NodePath fromNodeNames(NodeName ...$nodeNames)

No description

Parameters

NodeName ...$nodeNames

Return Value

NodePath

bool isEmpty()

No description

Return Value

bool

NodePath appendPathSegment(NodeName $nodeName)

IMMUTABLE function to create a new NodePath by appending a path segment. Returns a NEW NodePath object

Parameters

NodeName $nodeName

Return Value

NodePath

array getParts()

No description

Return Value

array

int getLength()

No description

Return Value

int

bool equals(NodePath $other)

No description

Parameters

NodePath $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