public function WebformSubmissionConditionsValidator::validateState in Webform 6.x
Same name and namespace in other branches
- 8.5 src/WebformSubmissionConditionsValidator.php \Drupal\webform\WebformSubmissionConditionsValidator::validateState()
Validate state with conditions.
Parameters
string $state: A state.
array $conditions: An associative array containing conditions.
\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.
Return value
bool|null TRUE if conditions validate. NULL if conditions can't be processed.
Overrides WebformSubmissionConditionsValidatorInterface::validateState
1 call to WebformSubmissionConditionsValidator::validateState()
- WebformSubmissionConditionsValidator::buildPages in src/
WebformSubmissionConditionsValidator.php - Apply states (aka conditional logic) to wizard pages.
File
- src/
WebformSubmissionConditionsValidator.php, line 569
Class
- WebformSubmissionConditionsValidator
- Webform submission conditions (#states) validator.
Namespace
Drupal\webformCode
public function validateState($state, array $conditions, WebformSubmissionInterface $webform_submission) {
// Process state/negate.
list($state, $negate) = $this
->processState($state);
// Validation conditions.
$result = $this
->validateConditions($conditions, $webform_submission);
// Skip invalid conditions.
if ($result === NULL) {
return NULL;
}
// Negate the result.
return $negate ? !$result : $result;
}