function DurationInterface::setDuration
Sets the duration.
Parameters
\DateInterval $duration: A duration to set.
2 methods override DurationInterface::setDuration()
- DurationIso8601::setDuration in core/
lib/ Drupal/ Core/ TypedData/ Plugin/ DataType/ DurationIso8601.php - Sets the duration.
- TimeSpan::setDuration in core/
lib/ Drupal/ Core/ TypedData/ Plugin/ DataType/ TimeSpan.php - Sets the duration.
File
-
core/
lib/ Drupal/ Core/ TypedData/ Type/ DurationInterface.php, line 28
Class
- DurationInterface
- Interface for durations.
Namespace
Drupal\Core\TypedData\TypeCode
public function setDuration(\DateInterval $duration);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.