function DurationIso8601::getDuration
Same name in other branches
- 8.9.x core/lib/Drupal/Core/TypedData/Plugin/DataType/DurationIso8601.php \Drupal\Core\TypedData\Plugin\DataType\DurationIso8601::getDuration()
- 10 core/lib/Drupal/Core/TypedData/Plugin/DataType/DurationIso8601.php \Drupal\Core\TypedData\Plugin\DataType\DurationIso8601::getDuration()
- 11.x core/lib/Drupal/Core/TypedData/Plugin/DataType/DurationIso8601.php \Drupal\Core\TypedData\Plugin\DataType\DurationIso8601::getDuration()
Overrides DurationInterface::getDuration
File
-
core/
lib/ Drupal/ Core/ TypedData/ Plugin/ DataType/ DurationIso8601.php, line 22
Class
- DurationIso8601
- The duration ISO8601 data type.
Namespace
Drupal\Core\TypedData\Plugin\DataTypeCode
public function getDuration() {
if ($this->value) {
// @todo: Add support for negative intervals on top of the DateInterval
// constructor.
return new \DateInterval($this->value);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.