1 | <?php |
||
34 | 1 | final class FiltersManager extends Nette\Object implements \ArrayAccess, \IteratorAggregate |
|
35 | { |
||
36 | /** |
||
37 | * @var \SplPriorityQueue |
||
38 | */ |
||
39 | private $filters = []; |
||
40 | |||
41 | /** |
||
42 | * @var Filters\IFactory[] |
||
43 | */ |
||
44 | private $factories = []; |
||
45 | |||
46 | public function __construct() |
||
50 | |||
51 | /** |
||
52 | * Check if a filter is registered |
||
53 | * |
||
54 | * @param string $name |
||
55 | * |
||
56 | * @return boolean |
||
57 | */ |
||
58 | public function has(string $name) : bool |
||
62 | |||
63 | /** |
||
64 | * Returns a registered filter class |
||
65 | * |
||
66 | * @param string $name |
||
67 | * |
||
68 | * @return Filters\IFactory|NULL |
||
69 | */ |
||
70 | public function get(string $name) |
||
74 | |||
75 | /** |
||
76 | * Register a filter class name |
||
77 | * |
||
78 | * @param Filters\IFactory $filter |
||
79 | * @param string $name |
||
80 | * @param int $priority |
||
81 | */ |
||
82 | public function register(Filters\IFactory $filter, string $name, int $priority = 0) |
||
89 | |||
90 | /** |
||
91 | * Unregisters a filter |
||
92 | * |
||
93 | * @param string $name |
||
94 | */ |
||
95 | public function unregister(string $name) |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function getIterator() |
||
124 | |||
125 | /** |
||
126 | * Implements the \ArrayAccess |
||
127 | * |
||
128 | * @param string $offset |
||
129 | * |
||
130 | * @return bool |
||
131 | */ |
||
132 | public function offsetExists($offset) |
||
136 | |||
137 | /** |
||
138 | * Implements the \ArrayAccess |
||
139 | * |
||
140 | * @param string $offset |
||
141 | * |
||
142 | * @return string[] |
||
143 | */ |
||
144 | public function offsetGet($offset) |
||
148 | |||
149 | /** |
||
150 | * Implements the \ArrayAccess |
||
151 | * |
||
152 | * @param string $offset |
||
153 | * @param string[]|NULL $value |
||
154 | * |
||
155 | * @throws Exceptions\InvalidStateException |
||
156 | */ |
||
157 | public function offsetSet($offset, $value) |
||
161 | |||
162 | /** |
||
163 | * Implements the \ArrayAccess |
||
164 | * |
||
165 | * @param string $offset |
||
166 | * |
||
167 | * @throws Exceptions\InvalidStateException |
||
168 | */ |
||
169 | public function offsetUnset($offset) |
||
173 | } |
||
174 |