1 | <?php |
||
24 | class RegistrationValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator |
||
25 | { |
||
26 | /** |
||
27 | * Configuration Manager |
||
28 | * |
||
29 | * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManager |
||
30 | */ |
||
31 | protected $configurationManager; |
||
32 | |||
33 | /** |
||
34 | * Object Manager |
||
35 | * |
||
36 | * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface |
||
37 | */ |
||
38 | protected $objectManager; |
||
39 | |||
40 | /** |
||
41 | * DI for $configurationManager |
||
42 | * |
||
43 | * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManager $configurationManager |
||
44 | */ |
||
45 | public function injectConfigurationManager( |
||
50 | |||
51 | /** |
||
52 | * DI for $objectManager |
||
53 | * |
||
54 | * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager |
||
55 | 9 | */ |
|
56 | public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) |
||
60 | |||
61 | 9 | /** |
|
62 | * Validates the given registration according to required fields set in plugin |
||
63 | * settings. For boolean fields, the booleanValidator is used and it is assumed, |
||
64 | 9 | * that boolean fields must have the value "TRUE" (for checkboxes) |
|
65 | 8 | * |
|
66 | 9 | * @param Registration $value Registration |
|
67 | 2 | * |
|
68 | * @return bool |
||
69 | */ |
||
70 | 7 | protected function isValid($value) |
|
113 | |||
114 | 1 | /** |
|
115 | * Processes the spam check and returns, if it failed or not |
||
116 | 1 | * |
|
117 | 2 | * @param Registration $registration |
|
118 | * @param array $settings |
||
119 | * @throws \DERHANSEN\SfEventMgt\SpamChecks\Exceptions\SpamCheckNotFoundException |
||
120 | * @return bool |
||
121 | */ |
||
122 | protected function isSpamCheckFailed(Registration $registration, array $settings): bool |
||
132 | |||
133 | /** |
||
134 | * Returns a validator object depending on the given type of the property |
||
135 | * |
||
136 | * @param string $type Type |
||
137 | * @param string $field The field |
||
138 | * |
||
139 | * @return \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator |
||
140 | */ |
||
141 | protected function getValidator($type, $field) |
||
163 | } |
||
164 |