DurationInterface.php 502 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Drupal\Core\TypedData\Type;
  3. /**
  4. * Interface for durations.
  5. *
  6. * @ingroup typed_data
  7. */
  8. interface DurationInterface {
  9. /**
  10. * Returns the duration.
  11. *
  12. * @return \DateInterval|null
  13. * A DateInterval object or NULL if there is no duration.
  14. *
  15. * @throws \Exception
  16. */
  17. public function getDuration();
  18. /**
  19. * Sets the duration.
  20. *
  21. * @param \DateInterval $duration
  22. * A duration to set.
  23. */
  24. public function setDuration(\DateInterval $duration);
  25. }