Source for file Tree.php
Documentation is available at Tree.php
* $Id: Tree.php 2097 2007-07-29 19:38:11Z romanb $
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @version $Revision: 2097 $
* @author Joe Simms <joe.simms@websites4.com>
* @param object $table reference to associated Doctrine_Table instance
* constructor, creates tree with reference to table and any options
* @param object $table instance of Doctrine_Table
* @param array $options options
public function __construct(Doctrine_Table $table, $options)
if ($table->getOption('inheritanceMap')) {
$subclasses =
$table->getOption('subclasses');
//echo $this->_baseComponent;
* Used to define table attributes required for the given implementation
* @throws Doctrine_Tree_Exception if table attributes have not been defined
* this method is used for setting up relations and attributes and should be used by specific implementations
* factory method to return tree instance based upon chosen implementation
* @param object $table instance of Doctrine_Table
* @param string $impName implementation (NestedSet, AdjacencyList, MaterializedPath)
* @param array $options options
* @return object $options instance of Doctrine_Node
* @throws Doctrine_Exception if class does not extend Doctrine_Tree
public static function factory(Doctrine_Table $table, $implName, $options =
array())
$class =
'Doctrine_Tree_' .
$implName;
return new $class($table, $options);
* gets tree attribute value
* sets tree attribute value
* Returns the base tree component.