You are here

private function SitewideAlertManager::requestDateTime in Sitewide Alert 8

The datetime of the current request.

Return value

\DateTime The DateTime of the current request.

2 calls to SitewideAlertManager::requestDateTime()
SitewideAlertManager::activeVisibleSitewideAlerts in src/SitewideAlertManager.php
Returns all active and currently visible sitewide alerts.
SitewideAlertManager::soonestAppearingScheduledAlertDateTime in src/SitewideAlertManager.php
Determines the datetime of the soonest expiring scheduled alert.

File

src/SitewideAlertManager.php, line 185

Class

SitewideAlertManager

Namespace

Drupal\sitewide_alert

Code

private function requestDateTime() {
  if (!$this->requestDateTime) {
    $this->requestDateTime = new \DateTime();
    $this->requestDateTime
      ->setTimestamp($this->time
      ->getRequestTime());
  }
  return $this->requestDateTime;
}