You are here

function amazon_data_cache in Amazon Product Advertisement API 6

Same name and namespace in other branches
  1. 7.2 amazon.module \amazon_data_cache()
  2. 7 amazon.module \amazon_data_cache()

Misc. helper functions for managing the wide array of Amazon data bitsies.

4 calls to amazon_data_cache()
amazon_http_request in ./amazon.module
amazon_item_clean_xml in ./amazon.module
Take the Amazon XML item and turn it into our own private 'cleaned' data structure.
amazon_item_insert in ./amazon.module
Insert 'cleaned' amazon item into database.
amazon_settings_form in ./amazon.admin.inc

File

./amazon.module, line 724

Code

function amazon_data_cache($reset = FALSE) {
  static $data;
  if (!isset($data) || $reset) {
    if (!$reset && ($cache = cache_get('amazon:metadata')) && !empty($cache->data)) {
      $data = $cache->data;
    }
    else {
      $data = array();
      $data['locales'] = _amazon_default_locales();
      drupal_alter('amazon_metadata', $data);
      cache_set('amazon:metadata', $data);
    }
  }
  return $data;
}