Bundle/WidgetMapBundle/Manager/WidgetMapManager.php
public function moveChildren(View $view, $beforeChild, $afterChild, $originalParent, $originalPosition)
    {
        if ($beforeChild && $afterChild) {
            $this->moveWidgetMap($view, $beforeChild, $originalParent, $originalPosition);

            $child = $beforeChild;
            while ($child->getChild(WidgetMap::POSITION_AFTER)) {
                $child = $child->getChild(WidgetMap::POSITION_AFTER);
            }
            if ($afterChild->getId() !== $child->getId()) {
                $this->moveWidgetMap($view, $afterChild, $child);
            }
        } elseif ($beforeChild) {
            $this->moveWidgetMap($view, $beforeChild, $originalParent, $originalPosition);
        } elseif ($afterChild) {
            $this->moveWidgetMap($view, $afterChild, $originalParent, $originalPosition);
        }
    }
public function moveChildren(View $view, $beforeChild, $afterChild, $originalParent, $originalPosition)
    {
        if ($beforeChild && $afterChild) {
            $this->moveWidgetMap($view, $beforeChild, $originalParent, $originalPosition);

            $child = $beforeChild;
            while ($child->getChild(WidgetMap::POSITION_AFTER)) {
                $child = $child->getChild(WidgetMap::POSITION_AFTER);
            }
            if ($afterChild->getId() !== $child->getId()) {
                $this->moveWidgetMap($view, $afterChild, $child);
            }
        } elseif ($beforeChild) {
            $this->moveWidgetMap($view, $beforeChild, $originalParent, $originalPosition);
        } elseif ($afterChild) {
            $this->moveWidgetMap($view, $afterChild, $originalParent, $originalPosition);
        }
    }
public function moveChildren ( View $ view , $ beforeChild , $ afterChild , $ originalParent , $ originalPosition ) { if ( $ beforeChild && $ afterChild ) { $ this -> moveWidgetMap ( $ view , $ beforeChild , $ originalParent , $ originalPosition ) ; $ child = $ beforeChild ; while ( $ child -> getChild ( WidgetMap :: POSITION_AFTER ) ) { $ child = $ child -> getChild ( WidgetMap :: POSITION_AFTER ) ; } if ( $ afterChild -> getId ( ) !== $ child -> getId ( ) ) { $ this -> moveWidgetMap ( $ view , $ afterChild , $ child ) ; } } elseif ( $ beforeChild ) { $ this -> moveWidgetMap ( $ view , $ beforeChild , $ originalParent , $ originalPosition ) ; } elseif ( $ afterChild ) { $ this -> moveWidgetMap ( $ view , $ afterChild , $ originalParent , $ originalPosition ) ; } }
If the moved widgetMap has someone at both his before and after, arbitrary move UP the before side
and find the first place after the before widgetMap hierarchy to place the after widgetMap.

@param View $view
@param $beforeChild
@param $afterChild
@param $originalParent
@param $originalPosition
If the moved widgetMap has someone at both his before and after arbitrary move UP the before side and find the first place after the before widgetMap hierarchy to place the after widgetMap .