function amazon_data_cache in Amazon Product Advertisement API 7
Same name and namespace in other branches
- 6 amazon.module \amazon_data_cache()
- 7.2 amazon.module \amazon_data_cache()
Misc. helper functions for managing the wide array of Amazon data bitsies.
8 calls to amazon_data_cache()
- amazon_get_associate_id in ./amazon.module 
- amazon_http_request in ./amazon.module 
- Create an issue an HTTP request to the Amazon API.
- 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 
- Basic Amazon settings form.
File
- ./amazon.module, line 797 
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;
}