Nette\Caching\Cache::remove PHP Method

remove() public method

Removes item from the cache.
public remove ( $key ) : void
return void
    public function remove($key)
    {
        $this->save($key, NULL);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Returns file last commit infos
  *
  * @param string $fileName
  * @param bool   $useCache
  * @return mixed
  * @throws gitHubException
  */
 public function getFileLastCommit($fileName, $useCache = TRUE)
 {
     if (!$useCache) {
         $this->cache->remove($fileName);
     }
     return $this->cache->load($fileName, function () use($fileName) {
         $path = $this->subdir ? $this->subdir . '/' : '';
         $url = self::GITHUB_URL . '/' . $this->user . '/' . $this->repo . '/commits?path=' . $path . $fileName;
         $tree = $this->run($url);
         return count($tree) === 0 ? NULL : $tree[0];
     });
 }
All Usage Examples Of Nette\Caching\Cache::remove