Properties

$batchMode

$batchMode : boolean

Controller is in batch mode

Type

boolean

$batchedResponses

$batchedResponses : array

Stack for batched responses

Type

array

$statusCode

$statusCode : integer

Status code

Type

integer

$headers

$headers : array

Default headers

Type

array

$payload

$payload : string

Response payload

Type

string

$format

$format : string

Response format, always json

Type

string

Methods

getStatusCode()

getStatusCode() : integer

Return status code

Returns

integer

getHeaders()

getHeaders() : array

Return current headers

Returns

array

getPayload()

getPayload() : string

Return payload

Returns

string

setStatusCode()

setStatusCode(integer  $code) 

Set status code

Parameters

integer $code

HTTP status code

setHeaders()

setHeaders(string  $key, string  $value) 

Set header value

Parameters

string $key

Header name

string $value

Header value

setPayload()

setPayload(string  $payload) 

Set payload

Parameters

string $payload

startBatchMode()

startBatchMode() 

Static method to enable batch mode return handling

endBatchMode()

endBatchMode() 

Static method to disable batch mode return handling

indexAction()

indexAction() : \Ceo\Api\Controllers\Phalcon\Dispatcher

Forwards to list action

Returns

\Ceo\Api\Controllers\Phalcon\Dispatcher

listAction()

listAction() : array

Return users

Returns

array

getAction()

getAction(string  $uuid) : array

Get single user by UUID

Parameters

string $uuid

User UUID

Returns

array

createAction()

createAction() : array

Create new user

Returns

array

updateAction()

updateAction(string  $uuid) : array

Update existing user.

Parameters

string $uuid

User UUID

Returns

array

updateMeAction()

updateMeAction() : array

Update the API user, just like update, but only works on current user

Returns

array

deleteAction()

deleteAction(string  $uuid) : array

Delete user

Parameters

string $uuid

User UUID

Returns

array

initResponse()

initResponse(integer  $status = 200) 

Reset response headers and payload

Parameters

integer $status

HTTP status code

_getContent()

_getContent(mixed  $payload) : string

Return json encoded string

Parameters

mixed $payload

Payload

Returns

string

getJsonData()

getJsonData() : array

Fetch POSTed/PUTed json data

Returns

array

output()

output() : \Ceo\Core\Controllers\Phalcon\Http\Response

Output the valid response, headers, status code and payload

Returns

\Ceo\Core\Controllers\Phalcon\Http\Response

getHttpCodeDescription()

getHttpCodeDescription(integer  $code) : string

Get http code description text based on code value

Parameters

integer $code

Returns

string

render()

render(string  $st_output, integer  $statusCode = 200) : \Ceo\Core\Controllers\Phalcon\Http\Response

Render output, resets headers and status code.

If batch mode is enabled, will return an array with status code and response.

Parameters

string $st_output

Output string

integer $statusCode

HTTP status code

Returns

\Ceo\Core\Controllers\Phalcon\Http\Response

renderException()

renderException(\Ceo\Core\Controllers\Exception  $e) : \Ceo\Core\Controllers\Phalcon\Http\Response

Render a trapped exception

Parameters

\Ceo\Core\Controllers\Exception $e

Returns

\Ceo\Core\Controllers\Phalcon\Http\Response