You are here

function amazon_media_get_table_name in Amazon Product Advertisement API 7

Same name and namespace in other branches
  1. 7.2 amazon_media/amazon_media.module \amazon_media_get_table_name()

Given an item, return the name of the table it's associated with.

Parameters

$item: populated amazon_item with $item['producttypename'] populated.

Return value

the name of the associated table.

2 calls to amazon_media_get_table_name()
amazon_media_amazon_item_insert in amazon_media/amazon_media.module
Insert the associated information into the related table.
amazon_media_amazon_item_load in amazon_media/amazon_media.module
Load and return additional information for an Amazon item.

File

amazon_media/amazon_media.module, line 117
Provides additional behaviors and data type for amazon items which are DVDs, software, video games, music, etc.

Code

function amazon_media_get_table_name($item) {
  static $names = array(
    'ABIS_BOOK' => 'amazon_book',
    'BOOKS_1973_AND_LATER' => 'amazon_book',
    'VIDEO_DVD' => 'amazon_dvd',
    'ABIS_DVD' => 'amazon_dvd',
    'ABIS_MUSIC' => 'amazon_music',
    'CONSOLE_VIDEO_GAMES' => 'amazon_software',
    'VIDEO_GAMES' => 'amazon_software',
    'SOFTWARE' => 'amazon_software',
  );
  if (!empty($names[$item['producttypename']])) {
    return $names[$item['producttypename']];
  }
}