protected function PhpDateIntervalConstraintValidator::isPhpDateIntervalObject in Duration Field 8.2
Same name and namespace in other branches
- 3.0.x src/Plugin/Validation/Constraint/PhpDateIntervalConstraintValidator.php \Drupal\duration_field\Plugin\Validation\Constraint\PhpDateIntervalConstraintValidator::isPhpDateIntervalObject()
Test if the given value 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 value is a valid ISO 8601 Duration string. Otherwise FALSE.
1 call to PhpDateIntervalConstraintValidator::isPhpDateIntervalObject()
- PhpDateIntervalConstraintValidator::validate in src/
Plugin/ Validation/ Constraint/ PhpDateIntervalConstraintValidator.php - Checks if the passed value is valid.
File
- src/
Plugin/ Validation/ Constraint/ PhpDateIntervalConstraintValidator.php, line 44
Class
- PhpDateIntervalConstraintValidator
- Validates the php_date_interval constraint.
Namespace
Drupal\duration_field\Plugin\Validation\ConstraintCode
protected function isPhpDateIntervalObject($value) {
return is_object($value) && is_a($value, 'DateInterval');
}