Rinvex\Repository\Traits\Cacheable::forgetCache PHP Method

forgetCache() public method

Forget the repository cache.
public forgetCache ( )
    public function forgetCache()
    {
        if ($this->getCacheLifetime()) {
            // Flush cache tags
            if (method_exists($this->getContainer('cache')->getStore(), 'tags')) {
                $this->getContainer('cache')->tags($this->getRepositoryId())->flush();
            } else {
                // Flush cache keys, then forget actual cache
                foreach ($this->flushCacheKeys() as $cacheKey) {
                    $this->getContainer('cache')->forget($cacheKey);
                }
            }
            $this->getContainer('events')->fire($this->getRepositoryId() . '.entity.cache.flushed', [$this]);
        }
        return $this;
    }