CacheableResourceResponse
class CacheableResourceResponse extends ResourceResponse implements CacheableResponseInterface (View source)
| internal | JSON:API maintains no PHP API since its API is the HTTP API. This class may change at any time and this will break any dependencies on it. |
Extends ResourceResponse with cacheability.
We want to have the same functionality for both responses that are cacheable and those that are not. This response class should be used in all instances where the response is expected to be cacheable.
Traits
Provides an implementation of CacheableResponseInterface.
Properties
| protected mixed | $responseData | Response data that should be serialized. |
from ResourceResponse |
| protected CacheableMetadata | $cacheabilityMetadata | The cacheability metadata. |
from CacheableResponseTrait |
Methods
__construct(mixed $data = NULL, int $status = 200, array $headers = [])
Constructor for ResourceResponse objects.
from
ResourceResponse
Details
__construct(mixed $data = NULL, int $status = 200, array $headers = [])
Constructor for ResourceResponse objects.
mixed
getResponseData()
Returns response data that should be serialized.
addCacheableDependency($dependency)
{@inheritdoc}
getCacheableMetadata()
{@inheritdoc}