public function SitewideAlertManager::activeSitewideAlerts in Sitewide Alert 8
Returns all active sitewide alerts.
Return value
\Drupal\sitewide_alert\Entity\SitewideAlertInterface[] Array of active sitewide alerts indexed by their ids.
Throws
\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
\Drupal\Component\Plugin\Exception\PluginNotFoundException
2 calls to SitewideAlertManager::activeSitewideAlerts()
- 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 56
Class
Namespace
Drupal\sitewide_alertCode
public function activeSitewideAlerts() {
/** @var \Drupal\sitewide_alert\Entity\SitewideAlertInterface[] $sitewideAlerts */
$sitewideAlerts = $this->entityTypeManager
->getStorage('sitewide_alert')
->loadByProperties([
'status' => 1,
]);
return $sitewideAlerts;
}