Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/TypedData/Type/DurationInterface.php \Drupal\Core\TypedData\Type\DurationInterface
  2. 9 core/lib/Drupal/Core/TypedData/Type/DurationInterface.php \Drupal\Core\TypedData\Type\DurationInterface

Interface for durations.

Hierarchy

Expanded class hierarchy of DurationInterface

All classes that implement DurationInterface

Related topics

2 files declare their use of DurationInterface
PrimitiveTypeConstraintValidator.php in core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/PrimitiveTypeConstraintValidator.php
TypedDataTest.php in core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php

File

core/lib/Drupal/Core/TypedData/Type/DurationInterface.php, line 10

Namespace

Drupal\Core\TypedData\Type
View source
interface DurationInterface {

  /**
   * Returns the duration.
   *
   * @return \DateInterval|null
   *   A DateInterval object or NULL if there is no duration.
   *
   * @throws \Exception
   */
  public function getDuration();

  /**
   * Sets the duration.
   *
   * @param \DateInterval $duration
   *   A duration to set.
   */
  public function setDuration(\DateInterval $duration);

}

Members

Namesort descending Modifiers Type Description Overrides
DurationInterface::getDuration public function Returns the duration.
DurationInterface::setDuration public function Sets the duration.