You are here

interface Iso8601StringInterface in Duration Field 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/DataType/Iso8601StringInterface.php \Drupal\duration_field\Plugin\DataType\Iso8601StringInterface

Interface for Iso8601String Typed Data objects.

Hierarchy

Expanded class hierarchy of Iso8601StringInterface

All classes that implement Iso8601StringInterface

See also

https://www.iso.org/iso-8601-date-and-time-format.html

3 files declare their use of Iso8601StringInterface
DurationField.php in src/Plugin/Field/FieldType/DurationField.php
DurationService.php in src/Service/DurationService.php
Iso8601StringConstraintValidatorBase.php in src/Plugin/Validation/Constraint/Iso8601StringConstraintValidatorBase.php

File

src/Plugin/DataType/Iso8601StringInterface.php, line 10

Namespace

Drupal\duration_field\Plugin\DataType
View source
interface Iso8601StringInterface {

  /**
   * The ISO 8601 Duration string representing an empty interval.
   *
   * @var string
   */
  const EMPTY_DURATION = 'P0M';

  /**
   * The Regex used to validate an ISO 8601 duration string.
   *
   * @var string
   */
  const DURATION_STRING_PATTERN = '/^P(\\d+Y)?(\\d+M)?(\\d+D)?(T)?(\\d+H)?(\\d+M)?(\\d+S)?$/';

}

Members

Namesort descending Modifiers Type Description Overrides
Iso8601StringInterface::DURATION_STRING_PATTERN constant The Regex used to validate an ISO 8601 duration string.
Iso8601StringInterface::EMPTY_DURATION constant The ISO 8601 Duration string representing an empty interval.