1 | <?php |
||
29 | class Validator extends AbstractFormDefinitionComponent implements ActivationUsageInterface, DataPreProcessorInterface |
||
30 | { |
||
31 | use ArrayConversionTrait; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | * @validate NotEmpty |
||
36 | */ |
||
37 | private $name; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | * @validate NotEmpty |
||
42 | * @validate Romm.ConfigurationObject:ClassImplements(interface=TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface) |
||
43 | */ |
||
44 | private $className; |
||
45 | |||
46 | /** |
||
47 | * @var int |
||
48 | * @validate Number |
||
49 | */ |
||
50 | protected $priority; |
||
51 | |||
52 | /** |
||
53 | * @var array |
||
54 | */ |
||
55 | protected $options = []; |
||
56 | |||
57 | /** |
||
58 | * @var \Romm\Formz\Form\Definition\Field\Validation\Message[] |
||
59 | */ |
||
60 | protected $messages = []; |
||
61 | |||
62 | /** |
||
63 | * @var \Romm\Formz\Form\Definition\Condition\Activation |
||
64 | * @validate Romm.Formz:Internal\ConditionIsValid |
||
65 | */ |
||
66 | protected $activation; |
||
67 | |||
68 | /** |
||
69 | * @var bool |
||
70 | */ |
||
71 | protected $useAjax = false; |
||
72 | |||
73 | /** |
||
74 | * @param string $name |
||
75 | * @param string $className |
||
76 | */ |
||
77 | public function __construct($name, $className) |
||
82 | |||
83 | /** |
||
84 | * @return string |
||
85 | */ |
||
86 | public function getName() |
||
90 | |||
91 | /** |
||
92 | * @return string |
||
93 | */ |
||
94 | public function getClassName() |
||
98 | |||
99 | /** |
||
100 | * @return int |
||
101 | */ |
||
102 | public function getPriority() |
||
106 | |||
107 | /** |
||
108 | * @param int $priority |
||
109 | */ |
||
110 | public function setPriority($priority) |
||
116 | |||
117 | /** |
||
118 | * @return array |
||
119 | */ |
||
120 | public function getOptions() |
||
124 | |||
125 | /** |
||
126 | * @param array $options |
||
127 | */ |
||
128 | public function setOptions(array $options) |
||
134 | |||
135 | /** |
||
136 | * @return Message[] |
||
137 | */ |
||
138 | public function getMessages() |
||
142 | |||
143 | /** |
||
144 | * @param string $identifier |
||
145 | * @return bool |
||
146 | */ |
||
147 | public function hasMessage($identifier) |
||
151 | |||
152 | /** |
||
153 | * @param string $identifier |
||
154 | * @return Message |
||
155 | * @throws EntryNotFoundException |
||
156 | */ |
||
157 | public function getMessage($identifier) |
||
165 | |||
166 | /** |
||
167 | * @param string $identifier |
||
168 | * @return Message |
||
169 | * @throws DuplicateEntryException |
||
170 | */ |
||
171 | public function addMessage($identifier) |
||
187 | |||
188 | /** |
||
189 | * @return ActivationInterface |
||
190 | * @throws SilentException |
||
191 | */ |
||
192 | public function getActivation() |
||
200 | |||
201 | /** |
||
202 | * @return bool |
||
203 | */ |
||
204 | public function hasActivation() |
||
208 | |||
209 | /** |
||
210 | * @return ActivationInterface |
||
211 | */ |
||
212 | public function addActivation() |
||
223 | |||
224 | /** |
||
225 | * @return bool |
||
226 | */ |
||
227 | public function doesUseAjax() |
||
231 | |||
232 | /** |
||
233 | * Turns the Ajax usage ON. |
||
234 | */ |
||
235 | public function activateAjaxUsage() |
||
241 | |||
242 | /** |
||
243 | * Turns the Ajax usage OFF. |
||
244 | */ |
||
245 | public function deactivateAjaxUsage() |
||
251 | |||
252 | /** |
||
253 | * @return Field |
||
254 | */ |
||
255 | public function getParentField() |
||
262 | |||
263 | /** |
||
264 | * @param DataPreProcessor $processor |
||
265 | */ |
||
266 | public static function dataPreProcessor(DataPreProcessor $processor) |
||
278 | } |
||
279 |