You are here

interface GranularityStringInterface in Duration Field 8.2

Same name and namespace in other branches
  1. 3.0.x src/Plugin/DataType/GranularityStringInterface.php \Drupal\duration_field\Plugin\DataType\GranularityStringInterface

Interface for Granularity String typed data objects.

A granularity string contains any or all of the following keys:

  • y (years)
  • m (months)
  • d (days)
  • h (hours)
  • i (minutes)
  • s (seconds)

Keys are separated by colons. The presence of a key means that degree of granularity is relevant. For example, a granularity string of y:m:d has keys for year, month and day, and therefore any time elements using that granularity would collect values for year, month and day. A granularity of y:s would indicate a granularity of years and seconds. An empty string means no granularity. Full granularity is y:m:d:h:i:s.

Hierarchy

Expanded class hierarchy of GranularityStringInterface

All classes that implement GranularityStringInterface

File

src/Plugin/DataType/GranularityStringInterface.php, line 23

Namespace

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

  /**
   * The Regex used to validate a granularity string.
   *
   * @var string
   */
  const GRANULARITY_STRING_PATTERN = '/^([yYmMdYhHiIsS]:)?([yYmMdYhHiIsS]:)?([yYmMdYhHiIsS]:)?([yYmMdYhHiIsS]:)?([yYmMdYhHiIsS]:)?([yYmMdYhHiIsS]:)?$/';

}

Members

Namesort descending Modifiers Type Description Overrides
GranularityStringInterface::GRANULARITY_STRING_PATTERN constant The Regex used to validate a granularity string.