public function DefaultIncidentStorage::addIncident in Radioactivity 4.0.x
Same name and namespace in other branches
- 8.3 src/DefaultIncidentStorage.php \Drupal\radioactivity\DefaultIncidentStorage::addIncident()
Adds an incident to the storage.
Parameters
\Drupal\radioactivity\IncidentInterface $incident: The incident object.
Overrides IncidentStorageInterface::addIncident
File
- src/
DefaultIncidentStorage.php, line 32
Class
- DefaultIncidentStorage
- Defines a default incident storage.
Namespace
Drupal\radioactivityCode
public function addIncident(IncidentInterface $incident) {
$incidents = $this->state
->get(self::STORAGE_KEY, []);
$incidents[] = $incident;
$this->state
->set(self::STORAGE_KEY, $incidents);
}