public function Incident::toJson in Radioactivity 8.3
Same name and namespace in other branches
- 8.2 src/Incident.php \Drupal\radioactivity\Incident::toJson()
- 4.0.x src/Incident.php \Drupal\radioactivity\Incident::toJson()
Convert to JSON format.
Return value
string Json encoded incident data.
Overrides IncidentInterface::toJson
File
- src/
Incident.php, line 98
Class
- Incident
- Data class for Radioactivity Incident.
Namespace
Drupal\radioactivityCode
public function toJson() {
return Json::encode([
'fn' => $this->fieldName,
'et' => $this->entityType,
'id' => $this->entityId,
'e' => $this->energy,
'h' => $this
->calculateHash(),
]);
}