1 | <?php |
||
5 | class TempStack extends \ArrayObject |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | private $root = 'root'; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $master = 'root'; |
||
16 | |||
17 | public function __construct() |
||
21 | |||
22 | /** |
||
23 | * Set the root module by name |
||
24 | * |
||
25 | * @param string $name |
||
26 | */ |
||
27 | public function setRoot($name) |
||
35 | |||
36 | public function isRoot($name) |
||
40 | |||
41 | public function getRoot() |
||
45 | |||
46 | /** |
||
47 | * Set the master module by name |
||
48 | * |
||
49 | * @param string $name |
||
50 | * |
||
51 | * @return string previous master |
||
52 | */ |
||
53 | public function setMaster($name) |
||
67 | |||
68 | /** |
||
69 | * Test whether a module name is the current master module |
||
70 | * |
||
71 | * @param string $name |
||
72 | * |
||
73 | * @return bool |
||
74 | */ |
||
75 | public function isMaster($name) |
||
79 | |||
80 | /** |
||
81 | * Get the name of the current master module |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getMaster() |
||
89 | |||
90 | /** |
||
91 | * Push a module name onto the stack, establishing later hierarchy for calls |
||
92 | * |
||
93 | * @param string $name |
||
94 | */ |
||
95 | private function pushStack($name) |
||
103 | |||
104 | /** |
||
105 | * Get the current ordered stack of modules that are loaded |
||
106 | * |
||
107 | * @return array |
||
108 | */ |
||
109 | public function modulePrecedence() |
||
122 | |||
123 | /** |
||
124 | * Jump to the next master or return false if we're already on it |
||
125 | * |
||
126 | * @return bool|string |
||
127 | */ |
||
128 | public function advanceMaster() |
||
140 | } |
||
141 |