DurationInterface.php

Same filename and directory in other branches
  1. 9 core/lib/Drupal/Core/TypedData/Type/DurationInterface.php
  2. 8.9.x core/lib/Drupal/Core/TypedData/Type/DurationInterface.php
  3. 11.x core/lib/Drupal/Core/TypedData/Type/DurationInterface.php

Namespace

Drupal\Core\TypedData\Type

File

core/lib/Drupal/Core/TypedData/Type/DurationInterface.php

View source
<?php

namespace Drupal\Core\TypedData\Type;


/**
 * Interface for durations.
 *
 * @ingroup typed_data
 */
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);

}

Interfaces

Title Deprecated Summary
DurationInterface Interface for durations.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.