-
-
Save mikemix/2ef9f5dd4a82bc392c19151862770b9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$cache = $entityManager->getCache(); | |
// prune entity cache | |
$cache->evictEntity(User::class, $user->getId()); | |
// prune entity's relationship cache | |
$cache->evictCollection(User::class, 'posts', $user->getId()); | |
// prune entire region of a relationship | |
$cache->evictCollectionRegion(User::class, 'posts'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment