protected function Iso8601StringConstraintValidatorBase::isIso8601String in Duration Field 8.2
Same name and namespace in other branches
- 3.0.x src/Plugin/Validation/Constraint/Iso8601StringConstraintValidatorBase.php \Drupal\duration_field\Plugin\Validation\Constraint\Iso8601StringConstraintValidatorBase::isIso8601String()
Test if a string is a valid ISO 8601 duration string.
Parameters
mixed $value: The item to check as an ISO 8601 duration string.
Return value
bool TRUE if the given value is a valid ISO 8601 duration string. FALSE if it is not.
2 calls to Iso8601StringConstraintValidatorBase::isIso8601String()
- Iso8601StringConstraintValidator::validate in src/
Plugin/ Validation/ Constraint/ Iso8601StringConstraintValidator.php - Checks if the passed value is valid.
- PhpDateIntervalConstraintValidator::validate in src/
Plugin/ Validation/ Constraint/ PhpDateIntervalConstraintValidator.php - Checks if the passed value is valid.
File
- src/
Plugin/ Validation/ Constraint/ Iso8601StringConstraintValidatorBase.php, line 23
Class
- Iso8601StringConstraintValidatorBase
- Provides a base for validating ISO 8601 String constraints.
Namespace
Drupal\duration_field\Plugin\Validation\ConstraintCode
protected function isIso8601String($value) {
if (is_string($value)) {
return preg_match(Iso8601StringInterface::DURATION_STRING_PATTERN, $value);
}
return FALSE;
}