public function upAction($pageId, $menuName)
    {
        $pageMenuRepo = $this->getDoctrine()->getRepository('FulgurioLightCMSBundle:PageMenu');
        $pageMenu = $pageMenuRepo->findOneBy(array('page' => $pageId, 'label' => $menuName));
        $position = $pageMenu->getPosition();
        if ($position > 1)
        {
            $pageMenuRepo->downMenuPagesPosition($menuName, $position - 1, $position);
            $pageMenu->setPosition($position - 1);
            $em = $this->getDoctrine()->getManager();
            $em->persist($pageMenu);
            $em->flush();
            $this->get('session')->getFlashBag()->add(
                    'notice',
                    $this->get('translator')->trans('fulgurio.lightcms.menus.moving_success_msg', array(), 'admin'));
        }
        return $this->redirect($this->generateUrl('AdminMenus'));
    }
public function upAction($pageId, $menuName)
    {
        $pageMenuRepo = $this->getDoctrine()->getRepository('FulgurioLightCMSBundle:PageMenu');
        $pageMenu = $pageMenuRepo->findOneBy(array('page' => $pageId, 'label' => $menuName));
        $position = $pageMenu->getPosition();
        if ($position > 1)
        {
            $pageMenuRepo->downMenuPagesPosition($menuName, $position - 1, $position);
            $pageMenu->setPosition($position - 1);
            $em = $this->getDoctrine()->getManager();
            $em->persist($pageMenu);
            $em->flush();
            $this->get('session')->getFlashBag()->add(
                    'notice',
                    $this->get('translator')->trans('fulgurio.lightcms.menus.moving_success_msg', array(), 'admin'));
        }
        return $this->redirect($this->generateUrl('AdminMenus'));
    }
public function upAction ( $ pageId , $ menuName ) { $ pageMenuRepo = $ this -> getDoctrine ( ) -> getRepository ( 'FulgurioLightCMSBundle:PageMenu' ) ; $ pageMenu = $ pageMenuRepo -> findOneBy ( array ( 'page' => $ pageId , 'label' => $ menuName ) ) ; $ position = $ pageMenu -> getPosition ( ) ; if ( $ position > 1 ) { $ pageMenuRepo -> downMenuPagesPosition ( $ menuName , $ position - 1 , $ position ) ; $ pageMenu -> setPosition ( $ position - 1 ) ; $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ pageMenu ) ; $ em -> flush ( ) ; $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'notice' , $ this -> get ( 'translator' ) -> trans ( 'fulgurio.lightcms.menus.moving_success_msg' , array ( ) , 'admin' ) ) ; } return $ this -> redirect ( $ this -> generateUrl ( 'AdminMenus' ) ) ; }
Move up page position in menu

@param number $pageId
@param string $menuName
@return
Move up page position in menu