15 private $cancelled =
false;
21 $this->ttl = (int)max($ttl, 0);
36 if (!property_exists($data,
'value')) {
37 throw new \InvalidArgumentException(
'$data must have a property "value"');
54 $this->cancelled =
true;
62 return $this->cancelled;
isCancelled()
{Has the response been cancelled?bool}
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}