Check whether or not a cache entry exists.
$cid: The cache id.
$var: The variable the cache should contain.
$bin: The bin the cache item was stored in.
TRUE on pass, FALSE on fail.
protected function checkCacheExists($cid, $var, $bin = NULL) {
if ($bin == NULL) {
$bin = $this->default_bin;
}
$cache = cache_get($cid, $bin);
return isset($cache->data) && $cache->data == $var;
}