Skip to content

Commit

Permalink
Clear correct query cache
Browse files Browse the repository at this point in the history
With new EntityManager creation system we need to clear the new cache
system too
  • Loading branch information
PowerKiKi committed Apr 26, 2023
1 parent 0a98237 commit 86b6f97
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/ORM/Query/Filter/AclFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Ecodev\Felix\ORM\Query\Filter;

use Doctrine\Common\Cache\ClearableCache;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Query\Filter\SQLFilter;
use Ecodev\Felix\Model\User;
Expand Down Expand Up @@ -105,10 +104,7 @@ public function setUser(?User $user): void
$this->user = $user;
$this->resetCache();

$cache = _em()->getConfiguration()->getQueryCacheImpl();
if ($cache instanceof ClearableCache) {
$cache->deleteAll();
}
_em()->getConfiguration()->getQueryCache()?->clear();
}

private function resetCache(): void
Expand Down

0 comments on commit 86b6f97

Please sign in to comment.