You are here

interface PeriodEntityInterface in Recurring Time Period 8

Interface for entities that represent a time period.

Hierarchy

Expanded class hierarchy of PeriodEntityInterface

All classes that implement PeriodEntityInterface

See also

\Drupal\recurring_period\Entity\PeriodEntityTrait

File

src/Entity/PeriodEntityInterface.php, line 12

Namespace

Drupal\recurring_period\Entity
View source
interface PeriodEntityInterface {

  /**
   * Gets the start date/time.
   *
   * @return \Drupal\Core\Datetime\DrupalDateTime
   *   The start date/time.
   */
  public function getStartDate();

  /**
   * Gets the end date/time.
   *
   * @return \Drupal\Core\Datetime\DrupalDateTime
   *   The end date/time.
   */
  public function getEndDate();

  /**
   * Gets the duration of the period, in seconds.
   *
   * @return int
   *   The duration.
   */
  public function getDuration();

  /**
   * Checks whether the given date/time is contained in the period.
   *
   * @param \Drupal\Core\Datetime\DrupalDateTime $date
   *   The date/time.
   *
   * @return bool
   *   TRUE if the date/time is contained in the period, FALSE otherwise.
   */
  public function contains(DrupalDateTime $date);

}

Members

Namesort descending Modifiers Type Description Overrides
PeriodEntityInterface::contains public function Checks whether the given date/time is contained in the period.
PeriodEntityInterface::getDuration public function Gets the duration of the period, in seconds.
PeriodEntityInterface::getEndDate public function Gets the end date/time.
PeriodEntityInterface::getStartDate public function Gets the start date/time.