/**
  * Validates the given registration according to required fields set in plugin
  * settings. For boolean fields, the booleanValidator is used and it is assumed,
  * that boolean fields must have the value "TRUE" (for checkboxes)
  *
  * @param Registration $value Registration
  *
  * @return bool
  */
 protected function isValid($value)
 {
     $settings = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, 'SfEventMgt', 'Pievent');
     // If no required fields are set, then the registration is valid
     if ($settings['registration']['requiredFields'] === '' || !isset($settings['registration']['requiredFields'])) {
         return TRUE;
     }
     $requiredFields = array_map('trim', explode(',', $settings['registration']['requiredFields']));
     $result = TRUE;
     foreach ($requiredFields as $requiredField) {
         if ($value->_hasProperty($requiredField)) {
             $validator = $this->getValidator(gettype($value->_getProperty($requiredField)));
             /** @var \TYPO3\CMS\Extbase\Error\Result $validationResult */
             $validationResult = $validator->validate($value->_getProperty($requiredField));
             if ($validationResult->hasErrors()) {
                 $result = FALSE;
                 foreach ($validationResult->getErrors() as $error) {
                     $this->result->forProperty($requiredField)->addError($error);
                 }
             }
         }
     }
     return $result;
 }