public function moveUp(Model\RowInterface $row)
    {
        $sibling = $this->editor->getRepository()->findSiblingRow($row, false);
        if (null === $sibling) {
            throw new InvalidOperationException(
                "The row can't be moved up as no sibling row has been found."
            );
        }

        $row->setPosition($row->getPosition() - 1);
        $sibling->setPosition($sibling->getPosition() + 1);

        $this->sortChildrenByPosition($row->getContainer(), 'rows');

        return $sibling;
    }
public function moveUp(Model\RowInterface $row)
    {
        $sibling = $this->editor->getRepository()->findSiblingRow($row, false);
        if (null === $sibling) {
            throw new InvalidOperationException(
                "The row can't be moved up as no sibling row has been found."
            );
        }

        $row->setPosition($row->getPosition() - 1);
        $sibling->setPosition($sibling->getPosition() + 1);

        $this->sortChildrenByPosition($row->getContainer(), 'rows');

        return $sibling;
    }
public function moveUp ( Model \ RowInterface $ row ) { $ sibling = $ this -> editor -> getRepository ( ) -> findSiblingRow ( $ row , false ) ; if ( null === $ sibling ) { throw new InvalidOperationException ( "The row can't be moved up as no sibling row has been found." ) ; } $ row -> setPosition ( $ row -> getPosition ( ) - 1 ) ; $ sibling -> setPosition ( $ sibling -> getPosition ( ) + 1 ) ; $ this -> sortChildrenByPosition ( $ row -> getContainer ( ) , 'rows' ) ; return $ sibling ; }
Moves the row up.

@param Model\RowInterface $row

@return Model\RowInterface the sibling row that has been swapped.
@throws InvalidOperationException
Moves the row up .