diff --git a/bundle/Core/SiteAccessAwareEntityManagerFactory.php b/bundle/Core/SiteAccessAwareEntityManagerFactory.php index 6a12a5d..0b3a3c3 100644 --- a/bundle/Core/SiteAccessAwareEntityManagerFactory.php +++ b/bundle/Core/SiteAccessAwareEntityManagerFactory.php @@ -13,7 +13,8 @@ namespace Novactive\Bundle\eZSEOBundle\Core; use Doctrine\Bundle\DoctrineBundle\Mapping\ContainerEntityListenerResolver; -use Doctrine\Common\Cache\ArrayCache; +use Symfony\Component\Cache\Adapter\ArrayAdapter; +use Doctrine\Common\Cache\Psr6\DoctrineProvider; use Doctrine\ORM\Configuration; use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; @@ -73,12 +74,12 @@ public function get(): EntityManagerInterface $connection = $this->registry->getConnection($connectionName); /** @var \Doctrine\DBAL\Connection $connection */ - $cache = new ArrayCache(); + $cache = new ArrayAdapter(); $config = new Configuration(); - $config->setMetadataCacheImpl($cache); + $config->setMetadataCacheImpl(DoctrineProvider::wrap($cache)); $driverImpl = $config->newDefaultAnnotationDriver(__DIR__.'/../Entity', false); $config->setMetadataDriverImpl($driverImpl); - $config->setQueryCacheImpl($cache); + $config->setQueryCacheImpl(DoctrineProvider::wrap($cache)); $config->setProxyDir($this->settings['cache_dir'].'/eZSEOBundle/'); $config->setProxyNamespace('eZSEOBundle\Proxies'); $config->setAutoGenerateProxyClasses($this->settings['debug']);