\Orpheus\InputController\HTTPControllerJSONHTTPResponse

The JSONHTTPResponse class

Summary

Methods
Properties
Constants
run()
process()
collectFrom()
getCode()
setCode()
setControllerOutput()
getControllerOutput()
__toString()
generateFromException()
generateFromUserException()
__construct()
render()
returnData()
getData()
setData()
No public properties found
No constants found
No protected methods found
$code
$controllerOutput
$data
N/A
No private methods found
No private properties found
N/A

Properties

$code

$code : integer

The HTTP response code

Type

integer

$controllerOutput

$controllerOutput : string

The output of the controller when running it

Type

string

$data

$data : array

The data of the JSON response

Type

array

Methods

run()

run() 

Process response to client

process()

process() 

Process the response

collectFrom()

collectFrom(string  $textCode, mixed  $other = null, string  $domain = 'global', string  $description = null) : NULL

Collect response data from parameters

Parameters

string $textCode
mixed $other
string $domain
string $description

Returns

NULL

getCode()

getCode() : integer

Get the code

Returns

integer

setControllerOutput()

setControllerOutput(string  $controllerOutput) 

Set the controller output

Parameters

string $controllerOutput

getControllerOutput()

getControllerOutput() : string

Get the controller output

Returns

string

__toString()

__toString() : string

Get this response as string

Returns

string

generateFromException()

generateFromException(\Exception  $exception, string  $action = 'Handling the request') : \Orpheus\InputController\HTTPController\JSONHTTPResponse

Generate HTMLResponse from Exception

Parameters

\Exception $exception
string $action

Returns

\Orpheus\InputController\HTTPController\JSONHTTPResponse

__construct()

__construct(array  $data = null) 

Constructor

Parameters

array $data

render()

render(string  $textCode, mixed  $other = null, string  $domain = 'global', string  $description = null) : \Orpheus\InputController\HTTPController\JSONHTTPResponse

Render the given data

Parameters

string $textCode
mixed $other
string $domain
string $description

Returns

\Orpheus\InputController\HTTPController\JSONHTTPResponse

getData()

getData() : mixed

Get the data

Returns

mixed