class NodeUriPathSegmentGenerator (View source)

Utility to generate a valid, non-conflicting uriPathSegment for nodes.

Properties

protected TransliterationService $transliterationService

Methods

static void
setUniqueUriPathSegment(NodeInterface $node)

Sets the best possible uriPathSegment for the given Node.

string
generateUriPathSegment(NodeInterface $node = null, string $text = null)

Generates a URI path segment for a given node taking it's language dimension into account

Details

static void setUniqueUriPathSegment(NodeInterface $node)

Sets the best possible uriPathSegment for the given Node.

Will use an already set uriPathSegment or alternatively the node name as base, then checks if the uriPathSegment already exists on the same level and appends a counter until a unique path segment was found.

Parameters

NodeInterface $node

Return Value

void

string generateUriPathSegment(NodeInterface $node = null, string $text = null)

Generates a URI path segment for a given node taking it's language dimension into account

Parameters

NodeInterface $node

Optional node to determine language dimension

string $text

Optional text

Return Value

string