public CacheableResponseTrait::getCacheableMetadata()
Returns the cacheability metadata for this response.
Return value
\Drupal\Core\Cache\CacheableMetadata
Overrides CacheableResponseInterface::getCacheableMetadata
File
- core/lib/Drupal/Core/Cache/CacheableResponseTrait.php, line 37
Class
- CacheableResponseTrait
- Provides an implementation of CacheableResponseInterface.
Namespace
Drupal\Core\Cache
Code
public function getCacheableMetadata() { // A trait doesn't have a constructor, so initialize the cacheability // metadata if that hasn't happened yet. if (!isset($this->cacheabilityMetadata)) { $this->cacheabilityMetadata = new CacheableMetadata(); } return $this->cacheabilityMetadata; }
Please login to continue.