ResourceResponse
class ResourceResponse extends Response implements CacheableResponseInterface, ResourceResponseInterface (View source)
Contains data for serialization before sending the response.
We do not want to abuse the $content property on the Response class to store our response data. $content implies that the provided data must either be a string or an object with a __toString() method, which is not a requirement for data used here.
Traits
Provides an implementation of CacheableResponseInterface.
Properties
| protected CacheableMetadata | $cacheabilityMetadata | The cacheability metadata. |
from CacheableResponseTrait |
| protected mixed | $responseData | Response data that should be serialized. |
from ResourceResponseTrait |
Methods
__construct(mixed $data = NULL, int $status = 200, array $headers = [])
Constructor for ResourceResponse objects.
Details
addCacheableDependency($dependency)
{@inheritdoc}
getCacheableMetadata()
{@inheritdoc}
mixed
getResponseData()
Returns response data that should be serialized.
__construct(mixed $data = NULL, int $status = 200, array $headers = [])
Constructor for ResourceResponse objects.