public function setCache($cache)
{
if ($cache instanceof Cache || class_exists('\\Doctrine\\Common\\Cache\\CacheProvider') && $cache instanceof \Doctrine\Common\Cache\CacheProvider) {
$this->cache = $cache;
return;
}
throw new \Exception('Cache not supported');
}