You are here

TimeConstraint.php in Time Field For Drupal 8.x / 9.x 2.x

Same filename and directory in other branches
  1. 8 src/Plugin/Validation/Constraint/TimeConstraint.php

File

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

namespace Drupal\time_field\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Checks that the submitted value is a unique integer.
 *
 * @Constraint(
 *   id = "time",
 *   label = @Translation("Time", context = "Validation"),
 *   type = "string"
 * )
 */
class TimeConstraint extends Constraint {

  /**
   * The default violation message.
   *
   * @var string
   */
  public static $message = 'This value is not a valid time.';

}

Classes

Namesort descending Description
TimeConstraint Checks that the submitted value is a unique integer.