class ContextOperation extends AbstractOperation (View source)

"context" operation working on ContentRepository nodes. Modifies the ContentRepository Context of each node in the current FlowQuery context by the given properties and returns the same nodes by identifier if they can be accessed in the new Context (otherwise they will be skipped).

Example:

q(node).context({'invisibleContentShown': true}).children()

Supported options:

  • workspaceName
  • dimensions
  • invisibleContentShown

Unsupported legacy options:

  • currentDateTime
  • targetDimensions
  • removedContentShown
  • inaccessibleContentShown

Traits

Properties

static protected string $shortName {@inheritdoc}
static protected int $priority {@inheritdoc}
protected ContentRepositoryRegistry $contentRepositoryRegistry
protected SubgraphCachePool $subgraphCachePool

Methods

string
createNodeHash(Node $node)

Create a string hash containing the node-aggregateId, cr-id, workspace-name, dimensionSpacePoint-hash and visibilityConstraints-hash. To be used for ensuring uniqueness or removing nodes.

bool
canEvaluate(mixed[] $context)

{@inheritdoc}

void
evaluate(FlowQuery $flowQuery, array $arguments)

{@inheritdoc}

Details

protected string createNodeHash(Node $node)

Create a string hash containing the node-aggregateId, cr-id, workspace-name, dimensionSpacePoint-hash and visibilityConstraints-hash. To be used for ensuring uniqueness or removing nodes.

Parameters

Node $node

Return Value

string

See also

Node::equals for comparison

bool canEvaluate(mixed[] $context)

{@inheritdoc}

Parameters

mixed[] $context

$context onto which this operation should be applied (array or array-like object)

Return Value

bool

true if the operation can be applied onto the $context, false otherwise

void evaluate(FlowQuery $flowQuery, array $arguments)

{@inheritdoc}

Parameters

FlowQuery $flowQuery

The FlowQuery object

array $arguments

The arguments for this operation

Return Value

void

Exceptions

FlowQueryException