You are here

public function GranularityServiceInterface::includeGranularityElement 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::includeGranularityElement()

Test if the given granularity element should be included.

Inclusion is determined based on the given granularity string.

Parameters

string $granularityElement: The granularity element to test for. Values can be:

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

string $granularityString: The granularity string to test against.

Return value

bool TRUE if the given granularity should be inclued, FALSE otherwise.

1 method overrides GranularityServiceInterface::includeGranularityElement()
GranularityService::includeGranularityElement in src/Service/GranularityService.php
Test if the given granularity element should be included.

File

src/Service/GranularityServiceInterface.php, line 71

Class

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

Namespace

Drupal\duration_field\Service

Code

public function includeGranularityElement($granularityElement, $granularityString);