You are here

Iso8601StringConstraint.php in Duration Field 3.0.x

Same filename and directory in other branches
  1. 8.2 src/Plugin/Validation/Constraint/Iso8601StringConstraint.php

File

src/Plugin/Validation/Constraint/Iso8601StringConstraint.php
View source
<?php

namespace Drupal\duration_field\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Checks that the submitted value is a valid ISO 8601 duration string.
 *
 * @Constraint(
 *   id = "iso_8601_string",
 *   label = @Translation("ISO 8601 Duration String", context = "Validation"),
 *   type = "string"
 * )
 */
class Iso8601StringConstraint extends Constraint {

  /**
   * The message shown when the value is not a valid ISO 8601 duration string.
   *
   * @var string
   */
  public $notIso8601 = '%value is not a valid ISO 8601 duration string';

}

Classes

Namesort descending Description
Iso8601StringConstraint Checks that the submitted value is a valid ISO 8601 duration string.