class FindOperation extends AbstractOperation (View source)

"find" operation working on ContentRepository nodes. This operation allows for retrieval of nodes specified by a path, identifier or node type (recursive).

Relative examples depending on the node's workspace, dimension space point, visibility constraints and location in the graph:

Example (node name):

q(node).find('main')

Example (relative path):

q(node).find('main/text1')

Example (node type):

q(node).find('[instanceof Neos.NodeTypes:Text]')

Example (multiple node types):

q(node).find('[instanceof Neos.NodeTypes:Text],[instanceof Neos.NodeTypes:Image]')

Example (node type with filter):

q(node).find('[instanceof Neos.NodeTypes:Text][text*="Neos"]')

Absolute / global examples depending only on the node's workspace and dimension space point as well as visibility constraints:

Example (absolute path):

q(site).find('//my-site/home')

Example (global identifier):

q(site).find('#30e893c1-caef-0ca5-b53d-e5699bb8e506')

Traits

Properties

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

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(array<int, mixed> $context)

{@inheritdoc}

void
evaluate(FlowQuery $flowQuery, array $arguments)

This operation operates rather on the given Context object than on the given node and thus may work with the legacy node interface until subgraphs are available {@inheritdoc}

array
getEntryPoints(array $contextNodes)

No description

array
addNodesById(NodeAggregateId $nodeAggregateId, array $entryPoints, array $result)

No description

array
addNodesByPath(NodePath|AbsoluteNodePath $nodePath, array $entryPoints, array $result)

No description

array
addNodesByType(NodeTypeName $nodeTypeName, array $entryPoints, array $result)

No description

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(array<int, mixed> $context)

{@inheritdoc}

Parameters

array<int, mixed> $context

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

Return Value

bool

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

void evaluate(FlowQuery $flowQuery, array $arguments)

This operation operates rather on the given Context object than on the given node and thus may work with the legacy node interface until subgraphs are available {@inheritdoc}

Parameters

FlowQuery $flowQuery

the FlowQuery object

array $arguments

the arguments for this operation

Return Value

void

Exceptions

FlowQueryException
Exception
FizzleException

protected array getEntryPoints(array $contextNodes)

No description

Parameters

array $contextNodes

Return Value

array

protected array addNodesById(NodeAggregateId $nodeAggregateId, array $entryPoints, array $result)

No description

Parameters

NodeAggregateId $nodeAggregateId
array $entryPoints
array $result

Return Value

array

protected array addNodesByPath(NodePath|AbsoluteNodePath $nodePath, array $entryPoints, array $result)

No description

Parameters

NodePath|AbsoluteNodePath $nodePath
array $entryPoints
array $result

Return Value

array

protected array addNodesByType(NodeTypeName $nodeTypeName, array $entryPoints, array $result)

No description

Parameters

NodeTypeName $nodeTypeName
array $entryPoints
array $result

Return Value

array