public function moveLeft(Model\BlockInterface $block)
    {
        $sibling = $this->editor->getRepository()->findSiblingBlock($block, false);
        if (null === $sibling) {
            throw new InvalidOperationException(
                "The block can't be moved to the right as no sibling block has been found."
            );
        }

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

        $this->sortChildrenByPosition($block->getRow(), 'blocks');

        return $sibling;
    }
public function moveLeft(Model\BlockInterface $block)
    {
        $sibling = $this->editor->getRepository()->findSiblingBlock($block, false);
        if (null === $sibling) {
            throw new InvalidOperationException(
                "The block can't be moved to the right as no sibling block has been found."
            );
        }

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

        $this->sortChildrenByPosition($block->getRow(), 'blocks');

        return $sibling;
    }
public function moveLeft ( Model \ BlockInterface $ block ) { $ sibling = $ this -> editor -> getRepository ( ) -> findSiblingBlock ( $ block , false ) ; if ( null === $ sibling ) { throw new InvalidOperationException ( "The block can't be moved to the right as no sibling block has been found." ) ; } $ block -> setPosition ( $ block -> getPosition ( ) - 1 ) ; $ sibling -> setPosition ( $ sibling -> getPosition ( ) + 1 ) ; $ this -> sortChildrenByPosition ( $ block -> getRow ( ) , 'blocks' ) ; return $ sibling ; }
Moves the block to the left.

@param Model\BlockInterface $block

@return Model\BlockInterface The sibling block that has been swapped.
@throws InvalidOperationException
Moves the block to the left .