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

$allowed_filters

$allowed_filters : 

Type

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 search action

Returns

\Ceo\Api\Controllers\Phalcon\Dispatcher

searchAction()

searchAction(  $type = null) : \Ceo\Api\Controllers\Phalcon\Http\Response

Search

Current runs a sphinx search and paginates against the DB This could change in the future.

Valid search parameters:

  • keywords - freeform key words
  • slug - item slug
  • type - currently only accepts 'content', 'container', 'user', 'author', 'tag'
  • filters - key/value array of filter params:
    • attachment_type - 'image', 'pdf', etc
    • attachment_name - file name
    • content_type - 'article', 'post', 'page', etc
  • has_attachment - 1 for items with attachments, 0 for items without.
  • created_after - items created after given date, ex: 2020-12-28T22:00:00
  • created_before - items created before given date, ex: 2015-12-28T14:00:00

Parameters

$type

Returns

\Ceo\Api\Controllers\Phalcon\Http\Response

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

handleUserSearch()

handleUserSearch() 

handleContainerSearch()

handleContainerSearch() 

handleAuthorSearch()

handleAuthorSearch() 

handleTagSearch()

handleTagSearch() 

handleSstsSearch()

handleSstsSearch() 

handleUrlSearch()

handleUrlSearch() 

handleContentSearch()

handleContentSearch() 

returnEmpty()

returnEmpty()