data = $data; } static function addWarning ($domain, $code, $message) { if (!isset (self::$reply->warnings)) self::$reply->warnings = []; self::$reply->warnings[] = new Message ($domain, $code, $message); } static function setError ($domain, $code, $message) { self::$reply->data = NULL; self::$reply->error = new Message ($domain, $code, $message); } static function sendReply () { header ('Content-Type: application/json; charset=UTF-8'); echo json_encode (self::$reply); } } ?>