public function RestIncidentStorage::getIncidents in Radioactivity 4.0.x
Same name and namespace in other branches
- 8.3 src/RestIncidentStorage.php \Drupal\radioactivity\RestIncidentStorage::getIncidents()
Gets all incidents from the storage.
Return value
\Drupal\radioactivity\IncidentInterface[] Array of incident objects.
Overrides IncidentStorageInterface::getIncidents
1 call to RestIncidentStorage::getIncidents()
- RestIncidentStorage::getIncidentsByType in src/
RestIncidentStorage.php - Gets all incidents from the storage per entity type.
File
- src/
RestIncidentStorage.php, line 29
Class
- RestIncidentStorage
- Defines a REST incident storage.
Namespace
Drupal\radioactivityCode
public function getIncidents() {
$data = $this
->getIncidentsFromStorage();
$result = [];
foreach ($data as $rows) {
foreach ($rows as $row) {
$incident = Incident::createFromPostData($row);
if ($incident
->isValid()) {
$result[] = $incident;
}
}
}
return $result;
}