You are here

function campaignmonitor_clear_cache in Campaign Monitor 8

Helper function to clear cache.

Parameters

$caches:

4 calls to campaignmonitor_clear_cache()
CampaignMonitor::clearCache in src/CampaignMonitor.php
Clears all the caches used by this wrapper object.
CampaignMonitorCampaignCampaignController::clearCampaignCache in modules/campaignmonitor_campaign/src/Controller/CampaignMonitorCampaignCampaignController.php
Callback to clear config cache.
CampaignMonitorCampaignController::clearCampaignCache in src/Controller/CampaignMonitorCampaignController.php
Callback to clear config cache.
CampaignMonitorListsController::clearListCache in src/Controller/CampaignMonitorListsController.php
Callback to clear config cache.

File

./campaignmonitor.module, line 557
Module that plugs in Campaign Monitor functionality to your Drupal web site. For Campaign Monitor information see: http://www.campaignmonitor.com/.

Code

function campaignmonitor_clear_cache($caches) {
  $module_handler = \Drupal::moduleHandler();

  // Flush entity and render persistent caches.
  $module_handler
    ->invokeAll('cache_flush');
  foreach (Cache::getBins() as $service_id => $cache_backend) {
    if (in_array($cache_backend->_serviceId, $caches)) {
      $cache_backend
        ->deleteAll();
    }
  }
}