/** * * @param string $string * @param string $language * @return string */ public function translate($string, $language) { $key = "{$string}-to-{$language}"; if ($this->cache->exists($key)) { return $this->cache->load($key); } if ($this->hasTranslate($string, $language)) { $strings = $this->getDBStrings($language); $string = $strings[$string]; $this->cache->save($key, $string); } return $string; }
/** * */ public function remove($key) { $this->primaryStorage->remove($key); $this->secondaryStorage->remove($key); }
/** * */ public function removeAllCache() { $this->cache->removeAll(); }
/** * Elimina el cache * @return unknown_type */ public function clearCache() { $this->cache->remove('acl'); }