class PhpDateIntervalConstraint in Duration Field 8.2
Same name and namespace in other branches
- 3.0.x src/Plugin/Validation/Constraint/PhpDateIntervalConstraint.php \Drupal\duration_field\Plugin\Validation\Constraint\PhpDateIntervalConstraint
Checks that the submitted value is a valid value for a Date Interval object.
Valid values are either PHP DateInterval objects, or an ISO 8601 duration string.
Plugin annotation
@Constraint(
id = "php_date_interval",
label = @Translation("PHP Date Interval", context = "Validation"),
type = "string"
)
Hierarchy
- class \Drupal\duration_field\Plugin\Validation\Constraint\PhpDateIntervalConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of PhpDateIntervalConstraint
File
- src/
Plugin/ Validation/ Constraint/ PhpDateIntervalConstraint.php, line 19
Namespace
Drupal\duration_field\Plugin\Validation\ConstraintView source
class PhpDateIntervalConstraint extends Constraint {
/**
* The message shown when the value is not a valid PHP DateInterval object.
*
* @var string
*/
public $notDateInterval = '%value is not valid for a PHP DateInterval object';
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PhpDateIntervalConstraint:: |
public | property | The message shown when the value is not a valid PHP DateInterval object. |