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()

Properties

static protected string $shortName {@inheritdoc}
static protected int $priority {@inheritdoc}
protected ContextFactoryInterface $contextFactory

Methods

bool
canEvaluate(array $context)

{@inheritdoc}

void
evaluate(FlowQuery $flowQuery, array $arguments)

{@inheritdoc}

Details

bool canEvaluate(array $context)

{@inheritdoc}

Parameters

array $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}

reimplement using TraversableNodeInterface / new NodeInterface once subgraphs are available

Parameters

FlowQuery $flowQuery

The FlowQuery object

array $arguments

The arguments for this operation

Return Value

void

Exceptions

FlowQueryException