Exemplo n.º 1
0
 /**
  * Checks the cache for the widget data.
  * If cache exists, it sets the TemplateData.
  *
  * @return string
  */
 public function isCached()
 {
     if (!$this->cacheDir) {
         return false;
     }
     $cache = new CacheStorageHelper($this->cacheDir, $this->uniqueCacheDir);
     $data = $cache->get($this->getUniqueWidgetId(), $this->cacheTimeout);
     if ($data) {
         $this->widget->setCached(true);
         $this->setTemplateData($data, true);
         return true;
     }
     return false;
 }