You are here

function media_acquiadam_flush_cache in Media: Acquia DAM 7

Clears given asset IDs from the local cache.

Parameters

array $assetIds: An array of asset IDs. Will flush all cache if nothing is provided.

4 calls to media_acquiadam_flush_cache()
media_acquiadam_config_settings in includes/media_acquiadam.admin.inc
Displays the media administration page.
media_acquiadam_dam_refresh_page in includes/media_acquiadam.pages.inc
Refresh the Acquia DAM asset from the DAM source.
media_acquiadam_entity_delete in ./media_acquiadam.module
Implements hook_entity_delete().
media_acquiadam_flush_outdated_cache in includes/media_acquiadam.cache.inc
Flush expired asset cache.

File

includes/media_acquiadam.cache.inc, line 111
Cache helpers and associated logic.

Code

function media_acquiadam_flush_cache(array $assetIds = []) {
  if (empty($assetIds)) {
    $assetIds = db_select('acquiadam_asset_cache', 'c')
      ->fields('c', [
      'asset_id',
    ])
      ->execute()
      ->fetchCol();
  }
  media_acquiadam_flush_image_styles($assetIds);
  db_delete('acquiadam_asset_cache')
    ->condition('asset_id', $assetIds)
    ->execute();
}