1 | <?php |
||
34 | abstract class AbstractMiddleware implements MiddlewareInterface, DataPreProcessorInterface |
||
35 | { |
||
36 | use StateMiddlewareDependencyTrait; |
||
37 | |||
38 | /** |
||
39 | * @var \Romm\Formz\Middleware\Option\DefaultOptionDefinition |
||
40 | */ |
||
41 | protected $options; |
||
42 | |||
43 | /** |
||
44 | * @param AbstractOptionDefinition $options |
||
45 | */ |
||
46 | public function __construct(AbstractOptionDefinition $options = null) |
||
59 | |||
60 | /** |
||
61 | * @todo |
||
62 | */ |
||
63 | final public function initialize() |
||
69 | |||
70 | /** |
||
71 | * You can override this method in your child class to initialize your |
||
72 | * middleware correctly. |
||
73 | */ |
||
74 | protected function initializeMiddleware() |
||
77 | |||
78 | /** |
||
79 | * Will stop the propagation of middlewares: the next middlewares wont be |
||
80 | * processed. |
||
81 | * |
||
82 | * Use with caution! |
||
83 | */ |
||
84 | final protected function stopPropagation() |
||
88 | |||
89 | /** |
||
90 | * Returns a new forward dispatcher, on which you can add options by calling |
||
91 | * its fluent methods. |
||
92 | * |
||
93 | * You must call the method `dispatch()` to actually dispatch the forward |
||
94 | * signal. |
||
95 | * |
||
96 | * @return Forward |
||
97 | */ |
||
98 | final protected function forward() |
||
102 | |||
103 | /** |
||
104 | * Returns a new redirect dispatcher, on which you can add options by |
||
105 | * calling its fluent methods. |
||
106 | * |
||
107 | * You must call the method `dispatch()` to actually dispatch the redirect |
||
108 | * signal. |
||
109 | * |
||
110 | * @return Redirect |
||
111 | */ |
||
112 | final protected function redirect() { |
||
115 | |||
116 | /** |
||
117 | * @return FormObject |
||
118 | */ |
||
119 | final protected function getFormObject() |
||
123 | |||
124 | /** |
||
125 | * @return FormResult |
||
126 | */ |
||
127 | final protected function getResult() |
||
131 | |||
132 | /** |
||
133 | * @return Request |
||
134 | */ |
||
135 | final protected function getRequest() |
||
139 | |||
140 | /** |
||
141 | * @return Arguments |
||
142 | */ |
||
143 | final protected function getArguments() |
||
147 | |||
148 | /** |
||
149 | * @return array |
||
150 | */ |
||
151 | final protected function getSettings() |
||
155 | |||
156 | /** |
||
157 | * @return int |
||
158 | */ |
||
159 | public function getPriority() |
||
163 | |||
164 | /** |
||
165 | * Returns the name of the signal on which this middleware is bound. |
||
166 | * |
||
167 | * @return string |
||
168 | * @throws EntryNotFoundException |
||
169 | */ |
||
170 | final public function getBoundSignalName() |
||
182 | |||
183 | /** |
||
184 | * @todo |
||
185 | * |
||
186 | * @param DataPreProcessor $processor |
||
187 | */ |
||
188 | public static function dataPreProcessor(DataPreProcessor $processor) |
||
198 | } |
||
199 |