Elgg  Version 5.1
Public Member Functions | Public Attributes | List of all members
Elgg\Services\AjaxResponse Interface Reference

JSON endpoint response. More...

Inheritance diagram for Elgg\Services\AjaxResponse:
Elgg\Ajax\Response

Public Member Functions

 setTtl ($ttl=0)
 Set the max-age for client caching. More...
 
 getTtl ()
 Get the max-age for client caching. More...
 
 setData (\stdClass $data)
 Set the response data. More...
 
 getData ()
 Get the response data, which will be a stdClass object with property "value". More...
 
 cancel ()
 Cancel the response and send a 403 header. More...
 
 isCancelled ()
 Has the response been cancelled? More...
 

Public Attributes

const RESPONSE_EVENT = 'ajax_response'
 

Detailed Description

JSON endpoint response.

Since
1.12.0

Definition at line 10 of file AjaxResponse.php.

Member Function Documentation

Elgg\Services\AjaxResponse::cancel ( )

Cancel the response and send a 403 header.

Returns
self

Implemented in Elgg\Ajax\Response.

Elgg\Services\AjaxResponse::getData ( )

Get the response data, which will be a stdClass object with property "value".

Returns

Implemented in Elgg\Ajax\Response.

Elgg\Services\AjaxResponse::getTtl ( )

Get the max-age for client caching.

Returns
int

Implemented in Elgg\Ajax\Response.

Elgg\Services\AjaxResponse::isCancelled ( )

Has the response been cancelled?

Returns
bool

Implemented in Elgg\Ajax\Response.

Elgg\Services\AjaxResponse::setData ( \stdClass  $data)

Set the response data.

Parameters
\stdClass$dataResponse data. Must be able to be encoded in JSON.
Returns
self

Implemented in Elgg\Ajax\Response.

Elgg\Services\AjaxResponse::setTtl (   $ttl = 0)

Set the max-age for client caching.

Parameters
int$ttlTime to cache in seconds
Returns
self

Implemented in Elgg\Ajax\Response.

Member Data Documentation

const Elgg\Services\AjaxResponse::RESPONSE_EVENT = 'ajax_response'

Definition at line 12 of file AjaxResponse.php.


The documentation for this interface was generated from the following file: