DateTimeInterface.php 607 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Drupal\Core\TypedData\Type;
  3. use Drupal\Core\Datetime\DrupalDateTime;
  4. /**
  5. * Interface for dates, optionally including a time.
  6. *
  7. * @ingroup typed_data
  8. */
  9. interface DateTimeInterface {
  10. /**
  11. * Returns the date time object.
  12. *
  13. * @return \Drupal\Core\Datetime\DrupalDateTime|null
  14. * A date object or NULL if there is no date.
  15. */
  16. public function getDateTime();
  17. /**
  18. * Sets the date time object.
  19. *
  20. * @param \Drupal\Core\Datetime\DrupalDateTime $dateTime
  21. * An instance of a date time object.
  22. */
  23. public function setDateTime(DrupalDateTime $dateTime);
  24. }