This is consistent with the Doctrine2 documentation on how to clear the cache. I'm not even sure if this is what you want, but I think this is something to try.
The Doctrine2 cache driver has different levels of deletion of cached entries.
, , ,
, , :
$deleted = $cacheDriver->deleteAll();
:
$deleted = $cacheDriver->deleteByPrefix('users_');
, Doctrine2 , .
: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/caching.html#deleting
, . , .
, :
$config = $em->getConfiguration();
$queryCacheDriver = $config->getQueryCacheImpl();
$metadataCacheDriver = $config->getMetadataCacheImpl();
, , cacheDriver - . . .
, , - , , . , , , , . , , . , , .
: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/caching.html#result-cache
$query = $em->createQuery('select u from \Entities\User u');
$query->useResultCache(false);
$results = $query->getResult();