Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
tree.php
Aller à la documentation de ce fichier.
1 <?php
2 /**
3  * @package Joomla.Legacy
4  * @subpackage Base
5  *
6  * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
7  * @license GNU General Public License version 2 or later; see LICENSE
8  */
9 
10 defined('JPATH_PLATFORM') or die;
11 
12 /**
13  * Tree Class.
14  *
15  * @package Joomla.Legacy
16  * @subpackage Base
17  * @since 11.1
18  * @deprecated 12.3 (Platform) & 4.0 (CMS)
19  * @codeCoverageIgnore
20  */
21 class JTree extends JObject
22 {
23  /**
24  * Root node
25  *
26  * @var object
27  * @since 11.1
28  */
29  protected $_root = null;
30 
31  /**
32  * Current working node
33  *
34  * @var object
35  * @since 11.1
36  */
37  protected $_current = null;
38 
39  /**
40  * Constructor
41  *
42  * @since 11.1
43  */
44  public function __construct()
45  {
46  JLog::add('JTree::__construct() is deprecated.', JLog::WARNING, 'deprecated');
47 
48  $this->_root = new JNode('ROOT');
49  $this->_current = & $this->_root;
50  }
51 
52  /**
53  * Method to add a child
54  *
55  * @param array &$node The node to process
56  * @param boolean $setCurrent True to set as current working node
57  *
58  * @return mixed
59  *
60  * @since 11.1
61  */
62  public function addChild(&$node, $setCurrent = false)
63  {
64  JLog::add('JTree::addChild() is deprecated.', JLog::WARNING, 'deprecated');
65 
66  $this->_current->addChild($node);
67  if ($setCurrent)
68  {
69  $this->_current = &$node;
70  }
71  }
72 
73  /**
74  * Method to get the parent
75  *
76  * @return void
77  *
78  * @since 11.1
79  */
80  public function getParent()
81  {
82  JLog::add('JTree::getParent() is deprecated.', JLog::WARNING, 'deprecated');
83 
84  $this->_current = &$this->_current->getParent();
85  }
86 
87  /**
88  * Method to get the parent
89  *
90  * @return void
91  *
92  * @since 11.1
93  */
94  public function reset()
95  {
96  JLog::add('JTree::reset() is deprecated.', JLog::WARNING, 'deprecated');
97 
98  $this->_current = &$this->_root;
99  }
100 }