Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
661 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. /**
  3. * @class Response
  4. * A simple JSON Response class.
  5. */
  6. class Response {
  7. public $success, $data, $message, $errors, $tid, $trace;
  8. public function __construct($params = array()) {
  9. $this->success = isset($params["success"]) ? $params["success"] : false;
  10. $this->message = isset($params["message"]) ? $params["message"] : '';
  11. $this->data = isset($params["data"]) ? $params["data"] : array();
  12. }
  13. public function to_json() {
  14. return json_encode(array(
  15. 'success' => $this->success,
  16. 'message' => $this->message,
  17. 'data' => $this->data
  18. ));
  19. }
  20. }