Returns a new cache implementation for a new namespace.
public forNamespace ( string $namespace ) : Pinq\Caching\ICacheAdapter | ||
$namespace | string | |
리턴 | Pinq\Caching\ICacheAdapter |
public function testThaGlobalNamespaceCacheWillNotClearOtherNamespaces() { $childNamespaceCache = $this->namespacedCache->forNamespace('CHILD::namespace'); $childNamespaceCache->save('in-child-namespace-1', 1); $childNamespaceCache->save('in-child-namespace-2', 2); $this->namespacedCache->save('in-namespace', 2); $this->cache->inGlobalNamespace()->clear(); $this->assertFalse($this->namespacedCache->contains('in-namespace')); $this->assertFalse($childNamespaceCache->contains('in-child-namespace-1')); $this->assertFalse($childNamespaceCache->contains('in-child-namespace-2')); }
public function getCompiledQueryCache(Queries\ISourceInfo $sourceInfo) { return $this->compiledQueryCache->forNamespace($sourceInfo->getHash()); }