CoreFiles by mySites.guru
tree.php100 lines, 1,820 bytes, from Joomla_3.2.2-Stable-Full_Package.zip
Raw History Compare with 3.2.1
md5
4c06f46dccc441f000eb59dd535eb8c4
sha1
6948ae64acbaf691358fdd76e496078e21873d8a
sha256
d7b9015ce5d66168f738a41fbbb1af9753badf3f3e236b6273aa9d4f6761125f
<?php
/**
 * @package     Joomla.Legacy
 * @subpackage  Base
 *
 * @copyright   Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die;

/**
 * Tree Class.
 *
 * @package     Joomla.Legacy
 * @subpackage  Base
 * @since       11.1
 * @deprecated  12.3 (Platform) & 4.0 (CMS)
 * @codeCoverageIgnore
 */
class JTree extends JObject
{
	/**
	 * Root node
	 *
	 * @var    object
	 * @since  11.1
	 */
	protected $_root = null;

	/**
	 * Current working node
	 *
	 * @var    object
	 * @since  11.1
	 */
	protected $_current = null;

	/**
	 * Constructor
	 *
	 * @since   11.1
	 */
	public function __construct()
	{
		JLog::add('JTree::__construct() is deprecated.', JLog::WARNING, 'deprecated');

		$this->_root = new JNode('ROOT');
		$this->_current = & $this->_root;
	}

	/**
	 * Method to add a child
	 *
	 * @param   array    &$node       The node to process
	 * @param   boolean  $setCurrent  True to set as current working node
	 *
	 * @return  mixed
	 *
	 * @since   11.1
	 */
	public function addChild(&$node, $setCurrent = false)
	{
		JLog::add('JTree::addChild() is deprecated.', JLog::WARNING, 'deprecated');

		$this->_current->addChild($node);
		if ($setCurrent)
		{
			$this->_current = &$node;
		}
	}

	/**
	 * Method to get the parent
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	public function getParent()
	{
		JLog::add('JTree::getParent() is deprecated.', JLog::WARNING, 'deprecated');

		$this->_current = &$this->_current->getParent();
	}

	/**
	 * Method to get the parent
	 *
	 * @return  void
	 *
	 * @since   11.1
	 */
	public function reset()
	{
		JLog::add('JTree::reset() is deprecated.', JLog::WARNING, 'deprecated');

		$this->_current = &$this->_root;
	}
}

The same content is in 13 releases, Joomla 3.2.2 to 3.3.6. See them all, or every version of this file.