class NodeOperations (View source)

Centralizes common operations like moving and copying of Nodes with Neos specific additional handling.

Properties

protected NodeTypeManager $nodeTypeManager
protected NodeServiceInterface $nodeService
protected NodeUriPathSegmentGenerator $nodeUriPathSegmentGenerator

Methods

create(NodeInterface $referenceNode, array $nodeData, string $position)

Helper method for creating a new node.

move(NodeInterface $node, NodeInterface $targetNode, string $position)

Move $node before, into or after $targetNode

copy(NodeInterface $node, NodeInterface $targetNode, string $position, string $nodeName = null)

Copy $node before, into or after $targetNode

getDesignatedParentNode(NodeInterface $targetNode, string $position)

No description

Details

NodeInterface create(NodeInterface $referenceNode, array $nodeData, string $position)

Helper method for creating a new node.

Parameters

NodeInterface $referenceNode
array $nodeData
string $position

Return Value

NodeInterface

Exceptions

InvalidArgumentException

NodeInterface move(NodeInterface $node, NodeInterface $targetNode, string $position)

Move $node before, into or after $targetNode

Parameters

NodeInterface $node
NodeInterface $targetNode
string $position

where the node should be added (allowed: before, into, after)

Return Value

NodeInterface

The same node given as first argument

Exceptions

NodeException

NodeInterface copy(NodeInterface $node, NodeInterface $targetNode, string $position, string $nodeName = null)

Copy $node before, into or after $targetNode

Parameters

NodeInterface $node

the node to be copied

NodeInterface $targetNode

the target node to be copied "to", see $position

string $position

where the node should be added in relation to $targetNode (allowed: before, into, after)

string $nodeName

optional node name (if empty random node name will be generated)

Return Value

NodeInterface

The copied node

Exceptions

NodeException

protected NodeInterface getDesignatedParentNode(NodeInterface $targetNode, string $position)

No description

Parameters

NodeInterface $targetNode
string $position

Return Value

NodeInterface