get cached value in time or return value
@param $value value or object to cache
@param $id key for cache
@return object
11402
public function cacheVal($value, $id = null) {
        if ($id == null) {
            if (is_object($value))
                $id = $this->getIDfromOjb($value);

            if ($id == null && $this->getConfig('debug')) {
                echo "no caching key";
                return $value;
            }
        }

        $cachefile = $this->getConfig('cacheDir') . '/' . utf8_decode($id);
        $cachetime = $this->getConfig('cacheTime');

        if (file_exists($cachefile) && time() - $cachetime < fileatime($cachefile)) {
            $ser = file_get_contents($cachefile);
            $val = bzdecompress(unserialize($ser));
            return $val;
        } else {
            $ser = bzcompress(serialize($value));
            file_put_contents($cachefile, $ser);
            return $value;
        }

        if ($this->getConfig('debug'))
            echo "no caching";
    }
768240
public function get($id) {
		// Format id
		$id = $this->_format($id);
		// Verify existence
		if(!$this->has($id)) {
			throw new NotFoundException("'$id' value does not exist");
		}
		// Get value
		return $this->values[$id]->getValue();
	}
1286855
public function getFromDataCache($id)
    {
        if (isset($this->_dataCache[$id])) {
            return $this->_dataCache[$id];
        } else if (isset($this->_dataCacheIgnoreVisible[$id])) {
            return $this->_dataCacheIgnoreVisible[$id];
        }
        return null;
    }
1238452
public function timestamp($value = null)
    {
        // Use now if no time was passed
        if ( ! $value) $value = $this->freshTimestamp();

        return $this->fromDateTime($value);
    }
1126946
function read($id) {
		if ($id!=$this->sid)
			$this->sid=$id;
		return Cache::instance()->exists($id.'.@',$data)?$data['data']:FALSE;
	}
429151
public function inc($id, $value = 1) {
		$id = $this->prepareId($id);
		
		return $this->getBackend()->inc($id, $value);
	}
1586
public function dec($id, $value = 1) {
		if (! $this->connectionCheckStatus) {
			$this->addServer();
		}
		
		$id     = $this->prepareId($id);
		$result = $this->getClient()->decrement($id, $value);
		
		if ($result === false && $this->operationsExceptions) {
			throw new OperationFailed('Decrementing of the data in the cache failed, ID: "' . $id . '"');
		}
		
		return $result;
	}
1321679
public function fetch($id)
    {
        try {
            $this->stopWatch->start('cache');
            $value = $this->cache->fetch($id);
            $this->stopWatch->stop('cache');
        }
        catch (\Exception $ex) {
            $value = false;
        }

        $this->collect('fetch', $id, $value != false, $value);

        return $value;
    }
1056784
public function setValue($id, $value)
    {
        $setting = parent::__invoke();
        $setting->findOrInitById($id);
        $setting->save(['value' => $value]);

        return $this;
    }
1157813
public function fetch( $id ) {

		if ( $this->contains( $id ) ) {
			$this->cacheHits++;
			return $this->cache->getItem( $id );
		}

		$this->cacheMisses++;
		return false;
	}
314971
static function get_manager( $id ) {
            $id = strtolower( $id );

            if ( ! isset( self::$_MANAGERS[ $id ] ) ) {
                self::$_MANAGERS[ $id ] = new FS_Cache_Manager( $id );
            }

            return self::$_MANAGERS[ $id ];
        }
245251
public function findCacheById(int $id)
    {

        // Check if already in addToCache
        if ($this->isCachedById($id)) {
            return $this->cacheById[$id];
        }

        return null;
    }
749750
private function fetchValueForKey($key, $value)
    {
        if (in_array($key, $this->getDates())) {
            return trim($value) === '' ? null : $value;
        }

        if (! $this->hasSetMutator($key)) {
            $value = $this->getAttribute($key);
        }

        if ($this->isJsonCastable($key) && ! is_null($value)) {
            $value = is_string($value) ? $this->getJsonCastValue($value) : $value;
        }

        return $value;
    }
1186716
protected function getRestoredPropertyValue($value)
    {
        return ($value instanceof ModelIdentifier)
            ? (new $value->class)->newQuery()->findOrFail($value->id)
            : $value;
    }
502997
protected function getValue(CachePut $cachePut, $value)
    {
        if(null === $cachePut->value)
        {
            return $value;
        }
        return ObjectArrayHelper::get($value, $cachePut->value);
    }
163666
public function getCacheId($id)
    {
        if(is_array($id))
        {
            $tmp = "";
            foreach ($id as $key => $value)
            {
                $tmp .= $key . "_" . $value;
            }
            $id = $tmp;
        }
        return $this->addCacheIndex($this->table_name . '_' . $id);
    }
415707
public function getById($id, $col = null)
    {
        $id = (int) $id;
        $model = $this->getCacheItem($id);

        if (!$model) {
            $model = $this->getMapper()->getById($id, $col);

            if ($this->useCache) {
                $this->setCacheItem($id, $model);
            }
        }

        return $model;
    }