Sulu\Component\HttpCache\CacheLifetimeResolverInterface::resolve PHP Method

resolve() public method

Get cache lifetime in seconds.
public resolve ( string $type, mixed $value ) : integer
$type string
$value mixed
return integer Cache lifetime in seconds
    public function resolve($type, $value);

Usage Example

Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function updateResponse(Response $response, StructureInterface $structure)
 {
     $response->headers->set(self::HEADER_HANDLERS, implode(', ', $this->handlerNames));
     $response->headers->set(self::HEADER_CLIENT_NAME, $this->proxyClientName);
     $response->headers->set(self::HEADER_STRUCTURE_TYPE, get_class($structure));
     $response->headers->set(self::HEADER_STRUCTURE_UUID, $structure->getUuid());
     // Structures implementing PageInterface have a TTL
     if ($structure instanceof PageInterface) {
         $cacheLifetimeData = $structure->getCacheLifeTime();
         $cacheLifeTime = $this->cacheLifetimeResolver->resolve($cacheLifetimeData['type'], $cacheLifetimeData['value']);
         $response->headers->set(self::HEADER_STRUCTURE_TTL, $cacheLifeTime);
     }
 }
All Usage Examples Of Sulu\Component\HttpCache\CacheLifetimeResolverInterface::resolve
CacheLifetimeResolverInterface