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

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

        $this->sortChildrenByPosition($container->getContent(), 'containers');

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

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

        $this->sortChildrenByPosition($container->getContent(), 'containers');

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

@param Model\ContainerInterface $container

@return Model\ContainerInterface the sibling container that has been swapped.
@throws InvalidOperationException
Moves the container up .