1 | <?php |
||
32 | 1 | final class DecoratorsManager extends Nette\Object implements \ArrayAccess, \IteratorAggregate |
|
33 | { |
||
34 | /** |
||
35 | * @var Decorators\IFactory[] |
||
36 | */ |
||
37 | protected $decorators = []; |
||
38 | |||
39 | /** |
||
40 | * Check if a decorator is registered |
||
41 | * |
||
42 | * @param string $name |
||
43 | * |
||
44 | * @return boolean |
||
45 | */ |
||
46 | public function has(string $name) : bool |
||
50 | |||
51 | /** |
||
52 | * Returns a registered decorator class |
||
53 | * |
||
54 | * @param string $name |
||
55 | * |
||
56 | * @return Decorators\IFactory|NULL |
||
57 | */ |
||
58 | public function get(string $name) |
||
62 | |||
63 | /** |
||
64 | * Register a decorator component factory |
||
65 | * |
||
66 | * @param Decorators\IFactory $decorator |
||
67 | * @param string $name |
||
68 | */ |
||
69 | public function register(Decorators\IFactory $decorator, string $name) |
||
77 | |||
78 | /** |
||
79 | * Un-registers a decorator |
||
80 | * |
||
81 | * @param string $name |
||
82 | */ |
||
83 | public function unregister(string $name) |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | public function getIterator() |
||
97 | |||
98 | /** |
||
99 | * Implements the \ArrayAccess |
||
100 | * |
||
101 | * @param string $offset |
||
102 | * |
||
103 | * @return bool |
||
104 | */ |
||
105 | public function offsetExists($offset) |
||
109 | |||
110 | /** |
||
111 | * Implements the \ArrayAccess |
||
112 | * |
||
113 | * @param string $offset |
||
114 | * |
||
115 | * @return Decorators\IFactory |
||
116 | */ |
||
117 | public function offsetGet($offset) |
||
121 | |||
122 | /** |
||
123 | * Implements the \ArrayAccess |
||
124 | * |
||
125 | * @param string $offset |
||
126 | * @param Decorators\IFactory|NULL $value |
||
127 | */ |
||
128 | public function offsetSet($offset, $value) |
||
132 | |||
133 | /** |
||
134 | * Implements the \ArrayAccess |
||
135 | * |
||
136 | * @param string $offset |
||
137 | */ |
||
138 | public function offsetUnset($offset) |
||
142 | } |
||
143 |