You are here

public function GranularityServiceInterface::convertGranularityStringToGranularityArray in Duration Field 8.2

Same name and namespace in other branches
  1. 3.0.x src/Service/GranularityServiceInterface.php \Drupal\duration_field\Service\GranularityServiceInterface::convertGranularityStringToGranularityArray()

Converts a granularity string to a granularity array.

Parameters

string $granularityString: The granularity string.

Return value

array An array containing the following keys. The value of each key will be either TRUE or FALSE.

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

TRUE values mean the element should be included as part of the granularity.

1 method overrides GranularityServiceInterface::convertGranularityStringToGranularityArray()
GranularityService::convertGranularityStringToGranularityArray in src/Service/GranularityService.php
Converts a granularity string to a granularity array.

File

src/Service/GranularityServiceInterface.php, line 50

Class

GranularityServiceInterface
Defines a granularity form element that works with granularity strings.

Namespace

Drupal\duration_field\Service

Code

public function convertGranularityStringToGranularityArray($granularityString);