mirror of
https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
synced 2026-06-01 21:54:48 -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
-2
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Class for managing services
|
||||
*/
|
||||
class Service
|
||||
class Service implements JsonSerializable
|
||||
{
|
||||
private $id;
|
||||
private $name;
|
||||
@@ -167,4 +167,15 @@ class Service
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
public function jsonSerialize() {
|
||||
global $statuses;
|
||||
return [
|
||||
"id" => $this->id,
|
||||
"name" => $this->name,
|
||||
"status" => $this->status,
|
||||
"status_string" => $statuses[$this->status]
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user