cacheTags; } /** * Add Cache Tags * * @param array $cacheTags * @return void */ public function addCacheTags(array $cacheTags): void { $this->cacheTags = array_unique(array_merge($this->cacheTags, $cacheTags)); } /** * Return if it's valid to cache the response * * @return bool */ public function isCacheable(): bool { return $this->cacheable; } /** * Set HTTP full page cache validity * * @param bool $cacheable */ public function setCacheValidity(bool $cacheable): void { $this->cacheable = $cacheable; } /** * Check if query is cacheable and we have a list of tags to populate * * @return bool */ public function shouldPopulateCacheHeadersWithTags() : bool { $cacheTags = $this->getCacheTags(); $isQueryCacheable = $this->isCacheable(); return !empty($cacheTags) && $isQueryCacheable; } /** * @inheritDoc */ public function _resetState(): void { $this->cacheTags = []; $this->cacheable = true; } }