trait CreateContentContextTrait (View source)

A trait to add create a content context

Properties

protected ContentContextFactory $_contextFactory
protected SiteRepository $_siteRepository

Methods

createContentContext(string $workspaceName, array $dimensions = [])

Create a ContentContext based on the given workspace name

createContextMatchingNodeData(NodeData $nodeData)

Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.

Details

protected ContentContext createContentContext(string $workspaceName, array $dimensions = [])

Create a ContentContext based on the given workspace name

Parameters

string $workspaceName

Name of the workspace to set for the context

array $dimensions

Optional list of dimensions and their values which should be set

Return Value

ContentContext

protected ContentContext createContextMatchingNodeData(NodeData $nodeData)

Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.

Parameters

NodeData $nodeData

Return Value

ContentContext