You are here

GranularityStringConstraint.php in Duration Field 8.2

File

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

namespace Drupal\duration_field\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Checks that the submitted value is a valid granularity string.
 *
 * @Constraint(
 *   id = "granularity_string",
 *   label = @Translation("Granularity String", context = "Validation"),
 *   type = "string"
 * )
 */
class GranularityStringConstraint extends Constraint {

  /**
   * The message shown when the value is not a valid granularity string.
   *
   * @var string
   */
  public $notValidGranularityString = '%value is not a valid granularity string';

}

Classes

Namesort descending Description
GranularityStringConstraint Checks that the submitted value is a valid granularity string.