JsonResult

JsonResult Class provided by System to return Data as JSON or MSGPACK.

package

SYSTEM\LOG

Methods

Retun JsonResult for given Exception

error(\Exception $e) : string
static

Arguments

$e

\Exception

Exception to be convered.

Response

string

Returns json string.

Retun JsonResult with failure status

fail() : string
static

Response

string

Returns json string.

Retun JsonResult with success status

ok() : string
static

Response

string

Returns json string.

Retun JsonResult with data given by array

toString(array $json_array, boolean $status = true, integer $start_time = NULL) : string
static

Arguments

$json_array

array

Data which should be included in the JSOn Result.

$status

boolean

true or false depending on success

$start_time

integer

To calculate Querytime - if Null System time is used.

Response

string

Returns json string.