Neos\Fusion\Core\Cache\ContentCache::flushByTag PHP Method

flushByTag() public method

Flush content cache entries by tag
public flushByTag ( string $tag ) : integer
$tag string A tag value that was assigned to a cache entry in TypoScript, for example "Everything", "Node_[…]", "NodeType_[…]", "DescendantOf_[…]" whereas "…" is the node identifier or node type respectively
return integer The number of cache entries which actually have been flushed
    public function flushByTag($tag)
    {
        return $this->cache->flushByTag($this->sanitizeTag($tag));
    }

Usage Example

 /**
  * Flush caches according to the previously registered node changes.
  *
  * @return void
  */
 public function shutdownObject()
 {
     if ($this->tagsToFlush !== array()) {
         foreach ($this->tagsToFlush as $tag => $logMessage) {
             $affectedEntries = $this->contentCache->flushByTag($tag);
             if ($affectedEntries > 0) {
                 $this->systemLogger->log(sprintf('Content cache: Removed %s entries %s', $affectedEntries, $logMessage), LOG_DEBUG);
             }
         }
     }
 }
All Usage Examples Of Neos\Fusion\Core\Cache\ContentCache::flushByTag