public function rebuildTree($entityClass = '',
        $parentEntity)
    {
        if ($entityClass === '') {
            throw new Exception('messages.error.classNameNotProvided');
        }
        if ($parentEntity === null) {
            throw new Exception('messages.error.cantRemakeTree');
        }
        $dqlLft = '
                UPDATE ' . $entityClass . ' a
                SET a.lft = a.lft + 2
                WHERE a.lft > ' . $parentEntity->rgt . '
            ';
        $q = $this->query($dqlLft);
        $q->execute();

        $dqlRgt = '
                UPDATE ' . $entityClass . ' a
                SET a.rgt = a.rgt + 2
                WHERE a.rgt >= ' . $parentEntity->rgt . '
            ';
        $q2 = $this->query($dqlRgt);
        $q2->execute();
    }
public function rebuildTree($entityClass = '',
        $parentEntity)
    {
        if ($entityClass === '') {
            throw new Exception('messages.error.classNameNotProvided');
        }
        if ($parentEntity === null) {
            throw new Exception('messages.error.cantRemakeTree');
        }
        $dqlLft = '
                UPDATE ' . $entityClass . ' a
                SET a.lft = a.lft + 2
                WHERE a.lft > ' . $parentEntity->rgt . '
            ';
        $q = $this->query($dqlLft);
        $q->execute();

        $dqlRgt = '
                UPDATE ' . $entityClass . ' a
                SET a.rgt = a.rgt + 2
                WHERE a.rgt >= ' . $parentEntity->rgt . '
            ';
        $q2 = $this->query($dqlRgt);
        $q2->execute();
    }
public function rebuildTree ( $ entityClass = '' , $ parentEntity ) { if ( $ entityClass === '' ) { throw new Exception ( 'messages.error.classNameNotProvided' ) ; } if ( $ parentEntity === null ) { throw new Exception ( 'messages.error.cantRemakeTree' ) ; } $ dqlLft = '
                UPDATE ' . $ entityClass . ' a
                SET a.lft = a.lft + 2
                WHERE a.lft > ' . $ parentEntity -> rgt . '
            ' ; $ q = $ this -> query ( $ dqlLft ) ; $ q -> execute ( ) ; $ dqlRgt = '
                UPDATE ' . $ entityClass . ' a
                SET a.rgt = a.rgt + 2
                WHERE a.rgt >= ' . $ parentEntity -> rgt . '
            ' ; $ q2 = $ this -> query ( $ dqlRgt ) ; $ q2 -> execute ( ) ; }
Rebuilds a tree structure by setting lft and rgt values across the rest of the tree
@param type $entityClass Class with defined entity
@param type $parentEntity Entity object
@throws Exception
Rebuilds a tree structure by setting lft and rgt values across the rest of the tree