Checks 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;
}
$cached = cache($bin)
->get($cid);
return isset($cached->data) && $cached->data == $var;
}