19 private $cancelled =
false;
25 $this->ttl = (int)
max($ttl, 0);
39 public function setData(\stdClass $data) {
40 if (!property_exists($data,
'value')) {
59 $this->cancelled =
true;
67 return $this->cancelled;
isCancelled()
{Has the response been cancelled?bool}
Exception thrown if an argument is not of the expected type.
setTtl($ttl=0)
{Set the max-age for client caching.Time to cache in seconds self}
setData(\stdClass $data)
{Set the response data.Response data. Must be able to be encoded in JSON. self}
cancel()
{Cancel the response and send a 403 header.self}
getData()
{Get the response data, which will be a stdClass object with property "value".}
getTtl()
{Get the max-age for client caching.int}