/**
* @param Cacheable $annotation
* @param InterceptionSuffixInterface $interception
*
* @return ResultInterface
*/
public function interceptSuffix(CacheAnnotationInterface $annotation, InterceptionSuffixInterface $interception) : ResultInterface
{
if (!$interception->getReturnValue()) {
return new EmptyResult();
}
$key = $this->calculateKey($annotation, $interception);
$item = new CacheItem($key);
$item->set($interception->getReturnValue());
$item->setTags($annotation->tags);
if ($annotation->ttl > 0) {
$item->expiresAfter($annotation->ttl);
}
foreach ($annotation->pools as $poolName) {
$pool = $this->poolManager->getPool($poolName);
$pool->save($item);
}
return new MissResult($interception, $key, $annotation->pools);
}