PHP Interface Elgg\Services\AjaxResponse

Since: 1.12.0
Mostrar archivo Open project: elgg/elgg Interface Usage Examples

Public Methods

Method Description
cancel ( ) : self Cancel the response and send a 403 header
getData ( ) : stdClass Get the response data, which will be a stdClass object with property "value"
getTtl ( ) : integer Get the max-age for client caching
isCancelled ( ) : boolean Has the response been cancelled?
setData ( stdClass $data ) : self Set the response data
setTtl ( integer $ttl ) : self Set the max-age for client caching

Method Details

cancel() public method

Cancel the response and send a 403 header
public cancel ( ) : self
return self

getData() public method

Get the response data, which will be a stdClass object with property "value"
public getData ( ) : stdClass
return stdClass

getTtl() public method

Get the max-age for client caching
public getTtl ( ) : integer
return integer

isCancelled() public method

Has the response been cancelled?
public isCancelled ( ) : boolean
return boolean

setData() public method

Set the response data
public setData ( stdClass $data ) : self
$data stdClass Response data. Must be able to be encoded in JSON.
return self

setTtl() public method

Set the max-age for client caching
public setTtl ( integer $ttl ) : self
$ttl integer Time to cache in seconds
return self