Move the node to the new position and change level by {$levelDiff}
@param Node\NodeInterface $node
@param int $pos
@param int $levelDiff
775551
public function move(Node\NodeInterface $node, $pos, $levelDiff)
	{
		// Current node's interval
		$left = $node->getLeftValue();
		$right = $node->getRightValue();
		
		// How big is the node
		$spaceUsed = $right - $left + 1;
		
		// Tells for how much index the node will be moved
		$moveA = 0;
		
		// Tells for how much index the nodes between the node's current and 
		// future position will be moved
		$moveB = 0;
		
		// Tells the interval for indeces to be moved which are not inside the 
		// node interval (usually $a <= $b)
		$a = $b = 0;
		
		// Move to the right
		if ($pos > $left) {
			$a = $right + 1;
			$b = $pos - 1;
			$moveA = $pos - $left - $spaceUsed;
			$moveB = - $spaceUsed;
			
		// Move to the left
		} else {
			$a = $pos;
			$b = $left - 1;
			$moveA = $pos - $left;
			$moveB = $spaceUsed;
		}
		
		// There is nothing to move
		if ($moveA == 0 && $levelDiff == 0) {
			return;
		}
		
		foreach ($this->array as $item) {
			/* @var $item Node\NodeInterface */
			$itemLeft = $item->getLeftValue();
			$itemRight = $item->getRightValue();
			
			// Children of the page being moved
			if (self::isBetween($itemLeft, $left, $right)) {
				
				if ( ! self::isBetween($itemRight, $left, $right)) {
					throw new Exception\InvalidStructure("Node $item left index is between $node index but the right isn't");
				}

				$this->moveNode($item, $moveA, $moveA, $levelDiff);

//				$item->moveLeftValue($moveA);
//				$item->moveRightValue($moveA);
//				$item->moveLevel($levelDiff);
				continue;
			}

			// Left index matches the interval
			if (self::isBetween($itemLeft, $a, $b)) {
				$this->moveNode($item, $moveB, 0, 0);
//				$item->moveLeftValue($moveB);
			}
			
			// Right index matches the interval
			if (self::isBetween($itemRight, $a, $b)) {
				$this->moveNode($item, 0, $moveB, 0);
//				$item->moveRightValue($moveB);
			}
		}
	}
42209
public function add(Node\NodeInterface $node)
	{
		$node->setRepository($this);
		parent::add($node);
		$this->array[] = $node;
	}
16885
public function moveNode(Section $node, Section $dest, $position)
    {
        return $this->_moveNode($node, $dest, $position);
    }
1019952
protected function finish(NodeInterface $node)
    {
        $this->persistenceManager->persistAll();

        $updateNodeInfo = new UpdateNodeInfo();
        $updateNodeInfo->setNode($node);
        $updateNodeInfo->recursive();

        $updateParentNodeInfo = new UpdateNodeInfo();
        $updateParentNodeInfo->setNode($node->getParent());

        $this->feedbackCollection->add($updateNodeInfo);
        $this->feedbackCollection->add($updateParentNodeInfo);

        $this->updateWorkspaceInfo();

        if ($node->getNodeType()->isOfType('Neos.Neos:Content') && ($this->getParentDomAddress() || $this->getSiblingDomAddress())) {

            // we can ONLY render out of band if:
            // 1) the parent of our new (or copied or moved) node is a ContentCollection; so we can directly update an element of this content collection
            if ($node->getParent()->getNodeType()->isOfType('Neos.Neos:ContentCollection') &&

                // 2) the parent DOM address (i.e. the closest RENDERED node in DOM is actually the ContentCollection; and
                //    no other node in between
                $this->getParentDomAddress() &&
                $this->getParentDomAddress()->getFusionPath() &&
                $this->getParentDomAddress()->getContextPath() === $node->getParent()->getContextPath()
            ) {
                $renderContentOutOfBand = new RenderContentOutOfBand();
                $renderContentOutOfBand->setNode($node);
                $renderContentOutOfBand->setParentDomAddress($this->getParentDomAddress());
                $renderContentOutOfBand->setSiblingDomAddress($this->getSiblingDomAddress());
                $renderContentOutOfBand->setMode($this->getMode());

                $this->feedbackCollection->add($renderContentOutOfBand);
            } else {
                $reloadDocument = new ReloadDocument();
                $reloadDocument->setNode($node);

                $this->feedbackCollection->add($reloadDocument);
            }
        }
    }
1279028
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setRoleId($value);
                break;
            case 1:
                $this->setPermissionId($value);
                break;
        } // switch()

        return $this;
    }
862772
protected function setNode($type, $pos)
    {
        if ($this->nodeType == 'tag') {
            // set tag specific vars to null
            // $type == tag should not be called here
            // see this::parseTag() for more
            $this->tagName = null;
            $this->tagAttributes = null;
            $this->isStartTag = null;
            $this->isEmptyTag = null;
            $this->isBlockElement = null;

        }
        $this->nodeType = $type;
        $this->node = substr($this->html, 0, $pos);
        $this->html = substr($this->html, $pos);
    }
1189843
public function nodeMove($value, $depth) {
        $this->node = $this->owner;
        parent::moveNode($value, $depth);
    }
85388
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setType($value);
                break;
            case 2:
                $this->setSkillId($value);
                break;
            case 3:
                $this->setTitle($value);
                break;
            case 4:
                $this->setDescendantClass($value);
                break;
        } // switch()

        return $this;
    }
275207
private function upgradeNode(NodeInterface $node, $propertyName, $locale)
    {
        foreach ($node->getNodes() as $child) {
            $this->upgradeNode($child, $propertyName, $locale);
        }

        if (false === $node->getPropertyValueWithDefault($propertyName, false)) {
            return;
        }

        $shadowLocale = $node->getPropertyValue($this->getPropertyName(self::SHADOW_BASE_PROPERTY, $locale));

        $tags = $this->getTags($node, $shadowLocale);
        $categories = $this->getCategories($node, $shadowLocale);
        $navigationContext = $this->getNavigationContext($node, $shadowLocale);

        $node->setProperty(sprintf(self::TAGS_PROPERTY, $locale), $tags);
        $node->setProperty(sprintf(self::CATEGORIES_PROPERTY, $locale), $categories);
        $node->setProperty(sprintf(self::NAVIGATION_CONTEXT_PROPERTY, $locale), $navigationContext);
    }
1284753
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setRemoteAppId($value);
                break;
            case 2:
                $this->setApiversion($value);
                break;
            case 3:
                $this->setName($value);
                break;
            case 4:
                $this->setVersion($value);
                break;
            case 5:
                $this->setConfigDisplayerrors($value);
                break;
            case 6:
                $this->setConfigBypasscache($value);
                break;
            case 7:
                $this->setConfigMinifymarkup($value);
                break;
            case 8:
                $this->setConfigDebugmode($value);
                break;
            case 9:
                $this->setConfigMaintenancemode($value);
                break;
            case 10:
                $this->setConfigGzipscripts($value);
                break;
            case 11:
                $this->setConfigRewriteurl($value);
                break;
            case 12:
                $this->setConfigAdminemail($value);
                break;
            case 13:
                $this->setConfigCachemode($value);
                break;
            case 14:
                $this->setStatuscode($value);
                break;
            case 15:
                $this->setExtensions($value);
                break;
            case 16:
                $this->setLog($value);
                break;
            case 17:
                $this->setPHP($value);
                break;
            case 18:
                $this->setMySQL($value);
                break;
        } // switch()
    }
811314
protected void moveNode(TreeNode node, double dx, double dy) {
    node.x += dx;
    node.y += dy;
    apply(node, null);

    TreeNode child = node.child;

    while (child != null) {
      moveNode(child, dx, dy);
      child = child.next;
    }
  }
1304955
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setActive($value);
                break;
            case 2:
                $this->setFiltertype($value);
                break;
            case 3:
                $this->setCode($value);
                break;
        } // switch()
    }
327434
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setCode($value);
                break;
            case 1:
                $this->setAtosCode($value);
                break;
            case 2:
                $this->setDecimals($value);
                break;
        } // switch()
    }
80670
protected function moveSubtreeTo($destLeft, $levelDelta, ConnectionInterface $con = null)
    {
        $left  = $this->getLeftValue();
        $right = $this->getRightValue();

        $treeSize = $right - $left +1;

        if (null === $con) {
            $con = Propel::getServiceContainer()->getWriteConnection(CategoryTableMap::DATABASE_NAME);
        }

        $con->transaction(function () use ($con, $treeSize, $destLeft, $left, $right, $levelDelta) {
            $preventDefault = false;

            // make room next to the target for the subtree
            ChildCategoryQuery::shiftRLValues($treeSize, $destLeft, null, $con);

            if (!$preventDefault) {

                if ($left >= $destLeft) { // src was shifted too?
                    $left += $treeSize;
                    $right += $treeSize;
                }

                if ($levelDelta) {
                    // update the levels of the subtree
                    ChildCategoryQuery::shiftLevel($levelDelta, $left, $right, $con);
                }

                // move the subtree to the target
                ChildCategoryQuery::shiftRLValues($destLeft - $left, $left, $right, $con);
            }

            // remove the empty room at the previous location of the subtree
            ChildCategoryQuery::shiftRLValues(-$treeSize, $right + 1, null, $con);

            // update all loaded nodes
            ChildCategoryQuery::updateLoadedNodes(null, $con);
        });
    }
960289
public function moveNode( $sourceNode, $position, $relatedNode )
    {
        $sourceNode = (int) $sourceNode;
        $sourceRoot = $this->getMapper()
                           ->findRootOf( $sourceNode );

        if ( empty( $sourceRoot ) ||
             ! $sourceRoot->isEditable() )
        {
            return array(
                'sourceNode'    => null,
                'position'      => $position,
                'relatedNode'   => $relatedNode,
                'success'       => false,
            );
        }

        $relatedNode = (int) $relatedNode;
        $relatedRoot = $this->getMapper()
                            ->findRootOf( $relatedNode );

        if ( empty( $relatedRoot ) ||
             ! $relatedRoot->isEditable() )
        {
            return array(
                'sourceNode'    => $sourceNode,
                'position'      => $position,
                'relatedNode'   => null,
                'success'       => false,
            );
        }

        $success = $this->getMapper()
                        ->moveNode( $sourceNode,
                                    strtolower( $position ),
                                    $relatedNode );

        return array(
            'sourceNode'    => $sourceNode,
            'position'      => $position,
            'relatedNode'   => $relatedNode,
            'success'       => (bool) $success,
        );
    }
573732
public function moveAsFirstChildOf(NodeInterface $parentNode)
	{
		$this->validateAddingChildren($parentNode);
		
		$pos = $parentNode->getLeftValue() + 1;
		$level = $parentNode->getLevel() + 1;
		$this->move($pos, $level);

		return $this;
	}
993694
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setUsername($value);
                break;
            case 2:
                $this->setPassword($value);
                break;
            case 3:
                $this->setSalt($value);
                break;
            case 4:
                $this->setFirstname($value);
                break;
            case 5:
                $this->setLastname($value);
                break;
            case 6:
                $this->setEmail($value);
                break;
            case 7:
                $this->setPhone($value);
                break;
            case 8:
                $this->setMemo($value);
                break;
            case 9:
                $this->setActivated($value);
                break;
            case 10:
                $this->setLastLogin($value);
                break;
            case 11:
                $this->setNotificationChange($value);
                break;
            case 12:
                $this->setNotificationError($value);
                break;
        } // switch()
    }