Source for file MDBnested.php
Documentation is available at MDBnested.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// $Id: MDBnested.php 320703 2011-12-08 22:08:40Z danielc $
require_once 'Tree/Dynamic/MDBnested.php';
* retreive all the data from the db and prepare the data so the structure
* can be built in the parent class
* @author Wolfram Kriesing <wolfram@kriesing.de>
* @param array the result of a query which retreives (all)
* the tree data from a DB
* @return array the result
function setup($res = null )
if ($this->options['whereAddOn']) {
$whereAddOn = 'WHERE '. $this->getOption('whereAddOn');
// build the query this way, that the root, which has no parent
$query = sprintf('SELECT * FROM %s %s ORDER BY %s',
// sort by the left-column, so we have the data
//sorted as it is supposed to be :-)
$this->_getColName ($orderBy)
if (MDB ::isError ($res = $this->dbh->getAll ($query))) {
return $this->_throwError ($res->getMessage (), __LINE__ );
return $this->_prepareResults ($res);
Documentation generated on Mon, 11 Mar 2019 15:47:06 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|