You are here

public function GranularityServiceInterface::convertGranularityArrayToGranularityString in Duration Field 3.0.x

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

Converts a granularity array to a granularity string.

Parameters

array $granularityArray: An array containing the following keys. The value of each key will be evaulated to 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.

Return value

string The array converted to a granularity string.

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

File

src/Service/GranularityServiceInterface.php, line 30

Class

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

Namespace

Drupal\duration_field\Service

Code

public function convertGranularityArrayToGranularityString(array $granularityArray);