Neos\Flow\Mvc\Routing\RouterCachingService::storeResolvedUriPath PHP Метод

storeResolvedUriPath() публичный Метод

Stores the $uriPath in the cache together with the $routeValues
public storeResolvedUriPath ( string $uriPath, array $routeValues ) : void
$uriPath string
$routeValues array
Результат void
    public function storeResolvedUriPath($uriPath, array $routeValues)
    {
        $uriPath = trim($uriPath, '/');
        $routeValues = $this->convertObjectsToHashes($routeValues);
        if ($routeValues === null) {
            return;
        }
        $cacheIdentifier = $this->buildResolveCacheIdentifier($routeValues);
        if ($cacheIdentifier !== null) {
            $tags = $this->generateRouteTags($uriPath, $routeValues);
            $this->resolveCache->set($cacheIdentifier, $uriPath, $tags);
        }
    }

Usage Example

 /**
  * @test
  */
 public function storeResolvedUriPathConvertsObjectsImplementingCacheAwareInterfaceToCacheEntryIdentifier()
 {
     $mockObject = $this->createMock(CacheAwareInterface::class);
     $mockObject->expects($this->atLeastOnce())->method('getCacheEntryIdentifier')->will($this->returnValue('objectIdentifier'));
     $routeValues = ['b' => 'route values', 'someObject' => $mockObject];
     $cacheIdentifier = '264b593d59582adea4ccc52b33cc093f';
     $matchingUriPath = 'uncached/matching/uri';
     $this->mockResolveCache->expects($this->once())->method('set')->with($cacheIdentifier, $matchingUriPath);
     $this->routerCachingService->storeResolvedUriPath($matchingUriPath, $routeValues);
 }
All Usage Examples Of Neos\Flow\Mvc\Routing\RouterCachingService::storeResolvedUriPath