1 | <?php |
||
12 | trait ChainsNestedItemsTrait |
||
13 | { |
||
14 | use DependsOnManagesItemsTrait; |
||
15 | |||
16 | /** |
||
17 | * Current level of nesting |
||
18 | * @var bool|string |
||
19 | */ |
||
20 | protected $currentLevel = false; |
||
21 | |||
22 | /** |
||
23 | * Deletes item at the current level of nesting (and below) |
||
24 | * @return mixed |
||
25 | */ |
||
26 | public function drop() |
||
31 | |||
32 | /** |
||
33 | * Sets the current level of nesting. |
||
34 | * |
||
35 | * @see Michaels\Manager\Contracts\ChainsNestedItemsInterface |
||
36 | * @param string $name Next level in dot notation to set |
||
37 | * @return $this |
||
38 | */ |
||
39 | public function __get($name) |
||
45 | |||
46 | /** |
||
47 | * Retrieves a value from the manager at the current nest level. |
||
48 | * |
||
49 | * @see Michaels\Manager\Contracts\ChainsNestedItemsInterface |
||
50 | * @param string $name The alias to be retrieved |
||
51 | * @param array $arguments Not used at present |
||
52 | * @throws \Michaels\Manager\Exceptions\ItemNotFoundException |
||
53 | * @return mixed item value |
||
54 | */ |
||
55 | public function __call($name, $arguments) |
||
59 | |||
60 | /** |
||
61 | * Sets an item at the current nest level. |
||
62 | * |
||
63 | * @see Michaels\Manager\Contracts\ChainsNestedItemsInterface |
||
64 | * @param string $key The alias to be retrieved |
||
65 | * @param mixed $value Value to be set |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function __set($key, $value) |
||
74 | |||
75 | /** |
||
76 | * Creates a prefix |
||
77 | * @return string |
||
78 | */ |
||
79 | protected function buildPrefix() |
||
91 | |||
92 | /** |
||
93 | * Adds to the chain |
||
94 | * @param $name |
||
95 | * @return $this |
||
96 | */ |
||
97 | protected function addToChain($name) |
||
104 | } |
||
105 |