There may be cases where you need to manually validate your TYPO3 Extbase domain model.
You can do this with the following lines:
$validator = $this->objectManager->get(ValidatorResolver::class)->getBaseValidatorConjunction(MODEL::class);
$validationResults = $validator->validate($MODELOBJECT);
if ($validationResults->hasErrors()) {
die('errors');
}
MODEL::class is the Namespace for your Model.
$MODELOBJECT is the instance of your Model created with new MODEL() or Generalutility::makeinstance...