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
Namespace
Drupal\sitewide_alertCode
private function requestDateTime() {
if (!$this->requestDateTime) {
$this->requestDateTime = new \DateTime();
$this->requestDateTime
->setTimestamp($this->time
->getRequestTime());
}
return $this->requestDateTime;
}