move() public method

Move $node before, into or after $targetNode
public move ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Neos\ContentRepository\Domain\Model\NodeInterface $targetNode, string $position ) : Neos\ContentRepository\Domain\Model\NodeInterface
$node Neos\ContentRepository\Domain\Model\NodeInterface
$targetNode Neos\ContentRepository\Domain\Model\NodeInterface
$position string where the node should be added (allowed: before, into, after)
return Neos\ContentRepository\Domain\Model\NodeInterface The same node given as first argument
Beispiel #1
0
 /**
  * Move the given node before, into or after the target node depending on the given position and renders it's content collection.
  *
  * @param Node $node The node to be moved
  * @param Node $targetNode The target node to be moved "to", see $position
  * @param string $position Where the node should be added in relation to $targetNode (allowed: before, into, after)
  * @param string $typoScriptPath The TypoScript path of the collection
  * @return void
  */
 public function moveAndRenderAction(Node $node, Node $targetNode, $position, $typoScriptPath)
 {
     $this->nodeOperations->move($node, $targetNode, $position);
     $this->redirectToRenderNode($node, $typoScriptPath);
 }