public function getCache()
{
if ($this->_cache === null) {
if ($this->_cacheModuleID !== '') {
$cache = Prado::getApplication()->getModule($this->_cacheModuleID);
} else {
$cache = Prado::getApplication()->getCache();
}
if ($cache === null || !$cache instanceof ICache) {
if ($this->_cacheModuleID !== '') {
throw new TConfigurationException('cachepagestatepersister_cachemoduleid_invalid', $this->_cacheModuleID);
} else {
throw new TConfigurationException('cachepagestatepersister_cache_required');
}
}
$this->_cache = $cache;
}
return $this->_cache;
}