class NodeShortcutResolver (View source)

Can resolve the target for a given shortcut.

Used for Neos Routing ({\Neos\Neos\FrontendRouting\EventSourcedFrontendNodeRoutePartHandler}), and redirects to a shortcut target when visiting the shortcut itself.

Methods

__construct(AssetRepository $assetRepository, ResourceManager $resourceManager)

No description

NodeAddress|UriInterface
resolveShortcutTarget(NodeAddress $nodeAddress, ContentRepository $contentRepository)

"adapter" for {resolveNode} when working with NodeAddresses.

UriInterface
resolveNode(DocumentNodeInfo $documentNodeInfo, ContentRepository $contentRepository)

This method is used during routing (when creating URLs), to directly generate URLs to the shortcut TARGET, if linking to a shortcut.

Details

__construct(AssetRepository $assetRepository, ResourceManager $resourceManager)

No description

Parameters

AssetRepository $assetRepository
ResourceManager $resourceManager

NodeAddress|UriInterface resolveShortcutTarget(NodeAddress $nodeAddress, ContentRepository $contentRepository)

"adapter" for {resolveNode} when working with NodeAddresses.

Note: The ContentStreamId is not required for this service, because it is only covering the live workspace

Parameters

NodeAddress $nodeAddress
ContentRepository $contentRepository

Return Value

NodeAddress|UriInterface

NodeAddress is returned if we want to link to another node (i.e. node is NOT a shortcut node; or target is a node); or UriInterface for links to fixed URLs (Asset URLs or external URLs)

Exceptions

InvalidShortcutException
NodeNotFoundException

UriInterface resolveNode(DocumentNodeInfo $documentNodeInfo, ContentRepository $contentRepository)

This method is used during routing (when creating URLs), to directly generate URLs to the shortcut TARGET, if linking to a shortcut.

Note: The ContentStreamId is not required for this service, because it is only covering the live workspace

Parameters

DocumentNodeInfo $documentNodeInfo
ContentRepository $contentRepository

Return Value

UriInterface

DocumentNodeInfo is returned if we want to link to another node (i.e. node is NOT a shortcut node; or target is a node); or UriInterface for links to fixed URLs (Asset URLs or external URLs)

Exceptions

InvalidShortcutException