mirror of
https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
synced 2026-06-02 14:14:47 -04:00
Re #11 - start working on an api
Also some locale negotiator bugfixes & it is now possible to serialize Service and Incident classess to JSON
This commit is contained in:
+13
-1
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Class for creating and rendering an incident
|
||||
*/
|
||||
class Incident
|
||||
class Incident implements JsonSerializable
|
||||
{
|
||||
private $id;
|
||||
private $date;
|
||||
@@ -183,4 +183,16 @@ class Incident
|
||||
</article>
|
||||
<?php
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
return [
|
||||
"id" => $this->id,
|
||||
"date" => $this->date,
|
||||
"end_date" => $this->end_date,
|
||||
"text" => $this->text,
|
||||
"type" => $this->type,
|
||||
"title" => $this->title,
|
||||
"username" => $this->username
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user