public function upPagesPosition($parentId, $position, $positionLimit = NULL)
    {
        if (is_null($positionLimit))
        {
            $query = $this->getEntityManager()->createQuery('UPDATE FulgurioLightCMSBundle:Page p SET p.position=p.position-1 WHERE p.position>=:position AND p.parent=:parentId AND p.page_type=:pageType');
        }
        else
        {
            $query = $this->getEntityManager()->createQuery('UPDATE FulgurioLightCMSBundle:Page p SET p.position=p.position-1 WHERE p.position>=:position AND p.position<=:positionLimit AND p.parent=:parentId AND p.page_type=:pageType');
            $query->setParameter('positionLimit', $positionLimit);
        }
        $query->setParameter('pageType', 'page');
        $query->setParameter('position', $position);
        $query->setParameter('parentId', $parentId);
        $query->getResult();
    }
public function upPagesPosition($parentId, $position, $positionLimit = NULL)
    {
        if (is_null($positionLimit))
        {
            $query = $this->getEntityManager()->createQuery('UPDATE FulgurioLightCMSBundle:Page p SET p.position=p.position-1 WHERE p.position>=:position AND p.parent=:parentId AND p.page_type=:pageType');
        }
        else
        {
            $query = $this->getEntityManager()->createQuery('UPDATE FulgurioLightCMSBundle:Page p SET p.position=p.position-1 WHERE p.position>=:position AND p.position<=:positionLimit AND p.parent=:parentId AND p.page_type=:pageType');
            $query->setParameter('positionLimit', $positionLimit);
        }
        $query->setParameter('pageType', 'page');
        $query->setParameter('position', $position);
        $query->setParameter('parentId', $parentId);
        $query->getResult();
    }
public function upPagesPosition ( $ parentId , $ position , $ positionLimit = NULL ) { if ( is_null ( $ positionLimit ) ) { $ query = $ this -> getEntityManager ( ) -> createQuery ( 'UPDATE FulgurioLightCMSBundle:Page p SET p.position=p.position-1 WHERE p.position>=:position AND p.parent=:parentId AND p.page_type=:pageType' ) ; } else { $ query = $ this -> getEntityManager ( ) -> createQuery ( 'UPDATE FulgurioLightCMSBundle:Page p SET p.position=p.position-1 WHERE p.position>=:position AND p.position<=:positionLimit AND p.parent=:parentId AND p.page_type=:pageType' ) ; $ query -> setParameter ( 'positionLimit' , $ positionLimit ) ; } $ query -> setParameter ( 'pageType' , 'page' ) ; $ query -> setParameter ( 'position' , $ position ) ; $ query -> setParameter ( 'parentId' , $ parentId ) ; $ query -> getResult ( ) ; }
Up pages position

@param number $parentId
@param number $position
@param number $positionLimit
Up pages position