Cache\Taggable\TaggablePoolInterface::clearTags PHP Method

clearTags() public method

Clear all items with a tag in $tags.
public clearTags ( array $tags ) : boolean
$tags array
return boolean
    public function clearTags(array $tags);

Usage Example

 public function onFlush(OnFlushEventArgs $args)
 {
     $em = $args->getEntityManager();
     $uow = $em->getUnitOfWork();
     $scheduledEntityChanges = ['insert' => $uow->getScheduledEntityInsertions(), 'update' => $uow->getScheduledEntityUpdates(), 'delete' => $uow->getScheduledEntityDeletions()];
     $cacheIds = [];
     foreach ($scheduledEntityChanges as $change => $entities) {
         foreach ($entities as $entity) {
             $cacheIds[get_class($entity)] = get_class($entity);
         }
     }
     if (count($cacheIds)) {
         $this->cachePool->clearTags($cacheIds);
     }
 }
All Usage Examples Of Cache\Taggable\TaggablePoolInterface::clearTags
TaggablePoolInterface