Services_Amazon
[ class tree: Services_Amazon ] [ index: Services_Amazon ] [ all elements ]

Class: Services_AmazonECS4

Source Location: /Services_Amazon-0.4.0/AmazonECS4.php

Class Overview


Class for accessing and retrieving information from Amazon's Web Services


Author(s):

Version:

  • Release: @package_version@

Methods


Inherited Variables

Inherited Methods


Class Details

[line 99]
Class for accessing and retrieving information from Amazon's Web Services
  • Author: John Downey <jdowney@gmail.com>
  • Author: Tatsuya Tsuruoka <ttsuruoka@p4life.jp>
  • Version: Release: @package_version@
  • Access: public
  • Uses: XML_Unserializer
  • Uses: HTTP_Request
  • Uses: PEAR


[ Top ]


Method Detail

Services_AmazonECS4 (Constructor)   [line 178]

Services_AmazonECS4 Services_AmazonECS4( string $subid, [string $associd = null])

Constructor

Parameters:

string   $subid   —  An Amazon Subscription ID used when quering Amazon servers
string   $associd   —  An Amazon Associate ID used in the URL's so a commision may be payed

[ Top ]

BrowseNodeLookup   [line 363]

array BrowseNodeLookup( string $browsenode_id, [array $options = array()])

Retrieves information about a browse node

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $result $amazon->BrowseNodeLookup('283155')// 283155='Books'
  4.  ?>

  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $browsenode_id   —  The browse node ID
array   $options   —  The optional parameters

[ Top ]

CartAdd   [line 394]

array CartAdd( string $cart_id, string $hmac, array $item, [array $options = array()])

Adds items to an existing remote shopping cart

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $item = array('ASIN' => 'aaaaaaaaaa''Quantity' => 1);
  4.  // $item = array(array('ASIN' => 'aaaaaaaaaa', 'Quantity' => 1),
  5.  //               array('OfferListingId' => 'bbbbbbbbbb', 'Quantity' => 10),
  6.  //               array('ASIN' => 'cccccccccc', 'Quantity' => 20));
  7.  $result $amazon->CartAdd('[Cart ID]''[HMAC]'$item);
  8.  ?>


Parameters:

string   $cart_id   —  A unique identifier for a cart
string   $hmac   —  A unique security token
array   $item   —  Products and the quantities
array   $options   —  The optional parameters

[ Top ]

CartClear   [line 414]

array CartClear( string $cart_id, string $hmac, [array $options = array()])

Removes all the contents of a remote shopping cart

Parameters:

string   $cart_id   —  A unique identifier for a cart
string   $hmac   —  A unique security token
array   $options   —  The optional parameters

[ Top ]

CartCreate   [line 443]

array CartCreate( array $item, [array $options = array()])

Creates a new remote shopping cart

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $item = array('ASIN' => 'aaaaaaaaaa''Quantity' => 1);
  4.  // $item = array(array('ASIN' => 'aaaaaaaaaa', 'Quantity' => 1),
  5.  //               array('ASIN' => 'cccccccccc', 'Quantity' => 20));
  6.  $result $amazon->CartCreate($item);
  7.  ?>


Parameters:

array   $item   —  Products and the quantities
array   $options   —  The optional parameters

[ Top ]

CartGet   [line 461]

array CartGet( string $cart_id, string $hmac, [array $options = array()])

Retrieves the contents of a remote shopping cart

Parameters:

string   $cart_id   —  A unique identifier for a cart
string   $hmac   —  A unique security token
array   $options   —  The optional parameters

[ Top ]

CartModify   [line 493]

array CartModify( string $cart_id, string $hmac, array $item, [array $options = array()])

Modifies the quantity of items in a cart and changes cart items to saved items

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $item = array('CartItemId' => 'aaaaaaaaaa''Quantity' => 1);
  4.  // $item = array('CartItemId' => 'aaaaaaaaaa', 'Action' => 'SaveForLater');
  5.  // $item = array(array('CartItemId' => 'aaaaaaaaaa', 'Quantity' => 1),
  6.  //               array('CartItemId' => 'cccccccccc', 'Quantity' => 20));
  7.  $result $amazon->CartModify('[Cart ID]''[HMAC]'$item);
  8.  ?>


Parameters:

string   $cart_id   —  A unique identifier for a cart
string   $hmac   —  A unique security token
array   $item   —  The CartItemId and the quantities or the Action
array   $options   —  The optional parameters

[ Top ]

CustomerContentLookup   [line 512]

array CustomerContentLookup( string $customer_id, [array $options = array()])

Retrieves publicly available content written by specific Amazon customers

Parameters:

string   $customer_id   —  A customer ID
array   $options   —  The optional parameters

[ Top ]

CustomerContentSearch   [line 529]

array CustomerContentSearch( [array $customer = null], [array $options = array()])

Searches for Amazon customers by name or email address

Parameters:

array   $customer   —  A customer's name or its email
array   $options   —  The optional parameters

[ Top ]

doBatch   [line 781]

array doBatch( string $operation, array $shared, array $params1, array $params2)

Combines requests for the same operation into a single request

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $shared = array('SearchIndex' => 'Books',
  4.                  'Keywords' => 'php');
  5.  $params1 = array('ItemPage' => '1');
  6.  $params2 = array('ItemPage' => '2');
  7.  $result $amazon->doBatch('ItemSearch'$shared$params1$params2);
  8.  ?>

  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $operation   —  The operation
array   $shared   —  Shared parameters
array   $params1   —  The parameters specific to the first request
array   $params2   —  The parameters specific to the second request

[ Top ]

doMultiOperation   [line 819]

array doMultiOperation( string $operation1, array $params1, string $operation2, array $params2)

Combines the different operations into a single request

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $params1 = array('SearchIndex' => 'Books',
  4.                   'Title' => 'sushi');
  5.  $params2 = array('Keywords' => 'tempura');
  6.  $result $amazon->doMultiOperation('ItemSearch'$params1,
  7.                                      'SellerListingSearch'$params2);
  8.  ?>

  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $operation1   —  The first operation
array   $params1   —  The parameters specific to the first request
string   $operation2   —  The second operation
array   $params2   —  The parameters specific to the second request

[ Top ]

getApiVersion   [line 191]

string getApiVersion( )

Retrieves the current version of this classes API
  • Return: The API version
  • Access: public

[ Top ]

getLastUrl   [line 342]

string getLastUrl( )

Retrieves the last URL accessed to the Amazon (for debugging)
  • Return: The Last URL
  • Access: public

[ Top ]

getProcessingTime   [line 331]

string getProcessingTime( )

Retrieves the processing time
  • Return: Processing time
  • Access: public

[ Top ]

Help   [line 554]

array Help( string $help_type, string $about, [array $options = array()])

Retrieves information about operations and response groups

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $result $amazon->Help('Operation''ItemLookup');
  4.  ?>

  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $help_type   —  The type of information
string   $about   —  The name of an operation or a response group
array   $options   —  The optional parameters

[ Top ]

ItemLookup   [line 582]

array ItemLookup( string $item_id, [array $options = array()])

Retrieves information for products

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $options = array();
  4.  $options['ResponseGroup''Large';
  5.  $result $amazon->ItemLookup('[ASIN(s)]'$options);
  6.  ?>


Parameters:

string   $item_id   —  Product IDs
array   $options   —  The optional parameters

[ Top ]

ItemSearch   [line 611]

array ItemSearch( string $search_index, [array $options = array()])

Searches for products

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $options = array();
  4.  $options['Keywords''sushi';
  5.  $options['Sort''salesrank';
  6.  $options['ResponseGroup''ItemIds,ItemAttributes,Images';
  7.  $result $amazon->ItemSearch('Books'$options);
  8.  ?>


Parameters:

string   $search_index   —  A search index
array   $options   —  The optional parameters

[ Top ]

ListLookup   [line 629]

array ListLookup( string $list_type, string $list_id, [array $options = array()])

Retrieves products in a specific list

Parameters:

string   $list_type   —  The type of list
string   $list_id   —  A list ID
array   $options   —  The optional parameters

[ Top ]

ListSearch   [line 657]

array ListSearch( string $list_type, array $keywords, [array $options = array()])

Searches for a wish list, baby registry, or wedding registry

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $keywords = array('Name' => 'hoge');
  4.  $result $amazon->ListSearch('WishList'$keywords);
  5.  ?>


Parameters:

string   $list_type   —  The type of list
array   $keywords   —  Parameters to search for
array   $options   —  The optional parameters

[ Top ]

SellerListingLookup   [line 676]

array SellerListingLookup( string $id_type, string $id, [array $options = array()])

Retrieves information about Amazon zShops and Marketplace products

Parameters:

string   $id_type   —  The type of ID
string   $id   —  The exchange ID or the listing ID
array   $options   —  The optional parameters

[ Top ]

SellerListingSearch   [line 703]

array SellerListingSearch( string $search_index, [array $options = array()])

Searches for Amazon zShops and Marketplace products

Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $keywords = array('Keywords' => 'pizza');
  4.  $result $amazon->SellerListingSearch('zShops'$keywords);
  5.  ?>


Parameters:

string   $search_index   —  The type of seller listings
array   $options   —  The optional parameters

[ Top ]

SellerLookup   [line 719]

array SellerLookup( string $seller_id, [array $options = array()])

Retrieves information about specific sellers
  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $seller_id   —  IDs for Amazon sellers
array   $options   —  The optional parameters

[ Top ]

setAssociateID   [line 215]

void setAssociateID( string $associd)

Sets an Associate ID
  • Access: public

Parameters:

string   $associd   —  An Associate ID

[ Top ]

setBaseUrl   [line 227]

void setBaseUrl( string $url)

Sets the base URL
  • Access: public

Parameters:

string   $url   —  The base url

[ Top ]

setCache   [line 289]

mixed setCache( [string $container = 'file'], [array $container_options = array()])

Enables caching the data

Requires Cache to be installed. Example:

  1.  <?php
  2.  $amazon = new Services_AmazonECS4('[your Subscription ID here]');
  3.  $amazon->setCache('file'array('cache_dir' => 'cache/'));
  4.  $amazon->setCacheExpire(86400)// 86400 seconds = 24 hours
  5.  $result $amazon->BrowseNodeLookup('283155');
  6.  ?>


Parameters:

string   $container   —  Name of container class
array   $container_options   —  Array with container class options

[ Top ]

setCacheExpire   [line 320]

void setCacheExpire( integer $secs)

Sets cache expire time

Amazon dictates that any prices that are displayed that may be over an hour old should be accompanied by some sort of timestamp. You can get around that by expiring any queries that use the time in an hour (3600 seconds).


Parameters:

integer   $secs   —  Expire time in seconds

[ Top ]

setLocale   [line 241]

mixed setLocale( string $locale)

Sets the locale passed when making a query to Amazon

Currently US, UK, DE, JP, FR, and CA are supported

  • Return: A PEAR_Error on error, a true on success
  • Access: public

Parameters:

string   $locale   —  The new locale to use

[ Top ]

setSubscriptionID   [line 203]

void setSubscriptionID( string $subid)

Sets a Subscription ID
  • Access: public

Parameters:

string   $subid   —  A Subscription ID

[ Top ]

setVersion   [line 264]

void setVersion( string $version)

Sets a version
  • Access: public

Parameters:

string   $version   —  A service version

[ Top ]

SimilarityLookup   [line 735]

array SimilarityLookup( string $item_id, [array $options = array()])

Retrieves products that are similar to Amazon products
  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $item_id   —  Product IDs
array   $options   —  The optional parameters

[ Top ]

TransactionLookup   [line 751]

array TransactionLookup( string $transaction_id, [array $options = array()])

Retrieves information about the status of financial transactions
  • Return: The array of information returned by the query
  • Access: public

Parameters:

string   $transaction_id   —  Transaction IDs
array   $options   —  The optional parameters

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:12:17 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.