Pinq\Caching\CSVFileCache::clearInNamespace PHP Method

clearInNamespace() public method

public clearInNamespace ( $namespace )
    public function clearInNamespace($namespace)
    {
        $fileData = $this->getFileData();
        $keysToUnset = [];
        foreach ($fileData as $key => $value) {
            if (strpos($key, $namespace) === 0) {
                $keysToUnset[] = $key;
            }
        }
        foreach ($keysToUnset as $key) {
            unset($fileData[$key]);
        }
        $this->flushFileData();
    }