Elgg  Version master
AjaxResponse.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Services;
4 
10 interface AjaxResponse {
11 
12  const RESPONSE_EVENT = 'ajax_response';
13 
20  public function setTtl($ttl = 0);
21 
27  public function getTtl();
28 
35  public function setData(\stdClass $data);
36 
42  public function getData();
43 
49  public function cancel();
50 
56  public function isCancelled();
57 }
isCancelled()
Has the response been cancelled?
setTtl($ttl=0)
Set the max-age for client caching.
cancel()
Cancel the response and send a 403 header.
if(!$entity instanceof\ElggUser) $data
Definition: attributes.php:13
JSON endpoint response.
setData(\stdClass $data)
Set the response data.
getData()
Get the response data, which will be a stdClass object with property "value".
getTtl()
Get the max-age for client caching.