You are here

public function DurationServiceInterface::convertDateArrayToDateInterval in Duration Field 8.2

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

Convert a PHP DateInterval object to an ISO 8601 duration string.

Parameters

array $input: An array containing the following keys:

  • y (year)
  • m (month)
  • d (day)
  • h (hour)
  • i (minute)
  • s (second)

Return value

\DateInterval A PHP DateInterval object for the given ISO 8601 duration string.

Throws

Drupal\duration_field\Exception\InvalidDurationException Thrown if $value is not a valid ISO 8601 Duration string.

1 method overrides DurationServiceInterface::convertDateArrayToDateInterval()
DurationService::convertDateArrayToDateInterval in src/Service/DurationService.php
Convert a PHP DateInterval object to an ISO 8601 duration string.

File

src/Service/DurationServiceInterface.php, line 77

Class

DurationServiceInterface
Interface for classes providing services for the Duration Field module.

Namespace

Drupal\duration_field\Service

Code

public function convertDateArrayToDateInterval(array $input);