copyAfter() public méthode

Copies this node after the given node
public copyAfter ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $nodeName ) : Neos\ContentRepository\Domain\Model\NodeInterface
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
$nodeName string
Résultat Neos\ContentRepository\Domain\Model\NodeInterface
 /**
  * Copy $node before, into or after $targetNode
  *
  * @param NodeInterface $node the node to be copied
  * @param NodeInterface $targetNode the target node to be copied "to", see $position
  * @param string $position where the node should be added in relation to $targetNode (allowed: before, into, after)
  * @param string $nodeName optional node name (if empty random node name will be generated)
  * @return NodeInterface The copied node
  * @throws NodeException
  */
 public function copy(NodeInterface $node, NodeInterface $targetNode, $position, $nodeName = null)
 {
     if (!in_array($position, array('before', 'into', 'after'), true)) {
         throw new NodeException('The position should be one of the following: "before", "into", "after".', 1346832303);
     }
     $nodeName = $this->nodeService->generateUniqueNodeName($this->getDesignatedParentNode($targetNode, $position)->getPath(), !empty($nodeName) ? $nodeName : null);
     switch ($position) {
         case 'before':
             $copiedNode = $node->copyBefore($targetNode, $nodeName);
             break;
         case 'after':
             $copiedNode = $node->copyAfter($targetNode, $nodeName);
             break;
         case 'into':
         default:
             $copiedNode = $node->copyInto($targetNode, $nodeName);
     }
     return $copiedNode;
 }