Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Item.php
Go to the documentation of this file.
1 <?php
8 
9 class Item
10 {
14  protected $class;
15 
19  protected $parent = null;
20 
24  protected $hash = null;
25 
29  protected $children = [];
30 
35  public function __construct($class, Item $parent = null)
36  {
37  $this->class = $class;
38  $this->parent = $parent;
39 
40  if ($parent) {
41  $parent->addChild($this);
42  }
43  }
44 
50  public function getClass()
51  {
52  return $this->class;
53  }
54 
61  public function addChild(Item $item)
62  {
63  $this->children[] = $item;
64  }
65 
71  public function getChildren()
72  {
73  return $this->children;
74  }
75 
81  public function getParent()
82  {
83  return $this->parent;
84  }
85 
92  public function setHash($hash)
93  {
94  $this->hash = $hash;
95  }
96 
102  public function getHash()
103  {
104  return $this->hash;
105  }
106 }
__construct($class, Item $parent=null)
Definition: Item.php:35