public function set(CacheKey $key, $value, $sessionLength = null)
 {
     $module = $key->getModule();
     $property = $key->getProperty();
     if ($sessionLength == null) {
         $sessionLength = $this->timeThreshold;
     }
     if (!isset($this->elements[$module][$property])) {
         $this->elements[$module][$property] = new FileElement($value, time() + $sessionLength);
     } else {
         /** @noinspection PhpUndefinedMethodInspection */
         $this->elements[$module][$property]->set($value, time() + $sessionLength);
     }
     if (!isset($_SESSION[$this->cacheMaintenanceTimeName][$module])) {
         $_SESSION[$this->cacheMaintenanceTimeName][$module] = time() + $sessionLength;
     }
     $this->changed = true;
 }
 /**
  * @param CacheKey $key
  * @return string
  */
 protected function getKey(CacheKey $key)
 {
     return static::$sCachePrefix . '__' . $key->getModule() . '||' . $key->getProperty();
 }
 /**
  * Unset cache value
  * @param CacheKey $key
  */
 public function clear(CacheKey $key)
 {
     unset($this->cache[$key->getModule()][$key->getProperty()]);
 }
 public function clear(CacheKey $key)
 {
     $module = $key->getModule();
     $id = $key->getProperty();
     if (!empty($id)) {
         unset($_SESSION[$this->cacheName][$module][$id]);
     } else {
         unset($_SESSION[$this->cacheName][$module]);
     }
 }