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 | */ |
||
56 | public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) |
||
60 | |||
61 | /** |
||
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 | * that boolean fields must have the value "TRUE" (for checkboxes) |
||
65 | * |
||
66 | * @param Registration $value Registration |
||
67 | * |
||
68 | * @return bool |
||
69 | */ |
||
70 | protected function isValid($value) |
||
112 | |||
113 | /** |
||
114 | * Processes the spam check and returns, if it failed or not |
||
115 | * |
||
116 | * @param Registration $registration |
||
117 | * @param array $settings |
||
118 | * @return bool |
||
119 | * @throws \DERHANSEN\SfEventMgt\SpamChecks\Exceptions\SpamCheckNotFoundException |
||
120 | */ |
||
121 | protected function isSpamCheckFailed(Registration $registration, array $settings): bool |
||
131 | |||
132 | /** |
||
133 | * Returns a validator object depending on the given type of the property |
||
134 | * |
||
135 | * @param string $type Type |
||
136 | * @param string $field The field |
||
137 | * |
||
138 | * @return \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator |
||
139 | */ |
||
140 | protected function getValidator($type, $field) |
||
162 | } |
||
163 |