PHP PEAR CVS 37 CVS PEAR TREE DYNAMIC DBNESTED PHP
Date: Thu, 03 Jul 2003 10:36:59 -0000

Subject: cvs: pear /Tree/Dynamic DBnested.php
From: cain@no-spam (Wolfram Kriesing)

cain Thu Jul 3 06:36:59 2003 EDT
Modified files: /pear/Tree/Dynamic DBnested.php Log:
- fixed getLevel to work again Index: pear/Tree/Dynamic/DBnested.php diff -u pear/Tree/Dynamic/DBnested.php:1.28 pear/Tree/Dynamic/DBnested.php:1.29
--- pear/Tree/Dynamic/DBnested.php:1.28 Tue Jun 24 06:39:01 2003
+++ pear/Tree/Dynamic/DBnested.php Thu Jul 3 06:36:59 2003
@@no-spam -16,7 +16,7 @@no-spam // | Authors: |
// +----------------------------------------------------------------------+
//
-// $Id: DBnested.php,v 1.28 2003/06/24 10:39:01 cain Exp $
+// $Id: DBnested.php,v 1.29 2003/07/03 10:36:59 cain Exp $
require_once('Tree/Common.php');
@@no-spam -748,21 +748,18 @@no-spam {
// subqueries would be cool :-)
$curElement = $this->getElement( $id );
- $query = sprintf( 'SELECT - *
- FROM - %s - WHERE - %s %s<=%s - AND %s>=%s - ORDER BY - %s',
- $this->table,
- $this->_getWhereAddOn(),
- $this->_getColName('left'),
- $curElement['left'],
- $this->_getColName('right'),
- $curElement['right'],
+ $query = sprintf( 'SELECT * FROM %s '.
+ 'WHERE %s %s<=%s AND %s>=%s '.
+ 'ORDER BY %s',
+ // set the FROM %s + $this->table,
+ // set the additional where add on + $this->_getWhereAddOn(),
+ // render 'left<=curLeft'
+ $this->_getColName('left'),$curElement['left'],
+ // render right>=curRight'
+ $this->_getColName('right'),$curElement['right'],
+ // set the order column $this->_getColName('left') );
return $query;
}