nestedContentFilter = $nestedContentFilter; } /** * Gets the cache to use * * @return Zend_Cache_Frontend */ protected function getCache() { $cache = \SS_Cache::factory(VersionFeedController::class); $cache->setOption('automatic_serialization', true); // Map 0 to null for unlimited lifetime $lifetime = Config::inst()->get(get_class($this), 'cache_lifetime') ?: null; $cache->setLifetime($lifetime); return $cache; } /** * Evaluates the result of the given callback * * @param string $key Unique key for this * @param callable $callback Callback for evaluating the content * @return mixed Result of $callback() */ public function getContent($key, $callback) { if($this->nestedContentFilter) { return $this->nestedContentFilter->getContent($key, $callback); } else { return call_user_func($callback); } } }