public function getNextPosition($parentId)
    {
        $query = $this->getEntityManager()->createQuery('SELECT MAX(p.position) FROM FulgurioLightCMSBundle:Page p WHERE p.parent=:parentId AND p.page_type=:pageType');
        $query->setParameter('pageType', 'page');
        $query->setParameter('parentId', $parentId);
        return $query->getSingleScalarResult() + 1;
    }
public function getNextPosition($parentId)
    {
        $query = $this->getEntityManager()->createQuery('SELECT MAX(p.position) FROM FulgurioLightCMSBundle:Page p WHERE p.parent=:parentId AND p.page_type=:pageType');
        $query->setParameter('pageType', 'page');
        $query->setParameter('parentId', $parentId);
        return $query->getSingleScalarResult() + 1;
    }
public function getNextPosition ( $ parentId ) { $ query = $ this -> getEntityManager ( ) -> createQuery ( 'SELECT MAX(p.position) FROM FulgurioLightCMSBundle:Page p WHERE p.parent=:parentId AND p.page_type=:pageType' ) ; $ query -> setParameter ( 'pageType' , 'page' ) ; $ query -> setParameter ( 'parentId' , $ parentId ) ; return $ query -> getSingleScalarResult ( ) + 1 ; }
Get next position in tree

@param number $parentId
@return number
Get next position in tree