home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Services / Ebay / Call / GetCrossPromotions.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  1.6 KB  |  62 lines

  1. <?PHP
  2. /**
  3.  * Get cross promotions for an items
  4.  *
  5.  * $Id: GetCrossPromotions.php,v 1.1 2004/10/28 17:14:53 schst Exp $
  6.  *
  7.  * @package Services_Ebay
  8.  * @author  Stephan Schmidt <schst@php.net>
  9.  * @link    http://developer.ebay.com/DevZone/docs/API_Doc/Functions/GetCrossPromotions/GetCrossPromotions.htm
  10.  */
  11. class Services_Ebay_Call_GetCrossPromotions extends Services_Ebay_Call 
  12. {
  13.    /**
  14.     * verb of the API call
  15.     *
  16.     * @var  string
  17.     */
  18.     protected $verb = 'GetCrossPromotions';
  19.  
  20.    /**
  21.     * arguments of the call
  22.     *
  23.     * @var  array
  24.     */
  25.     protected $args = array(
  26.                             'PromotionMethod' => 'CrossSell'
  27.                         );
  28.    /**
  29.     * parameter map that is used, when scalar parameters are passed
  30.     *
  31.     * @var  array
  32.     */
  33.     protected $paramMap = array(
  34.                                  'ItemId',
  35.                                  'PromotionMethod',
  36.                                  'PromotionViewMode'
  37.                                 );
  38.    /**
  39.     * make the API call
  40.     *
  41.     * @param    object Services_Ebay_Session
  42.     * @return   string
  43.     */
  44.     public function call(Services_Ebay_Session $session)
  45.     {
  46.         $bak = $this->args;
  47.         $this->args['Context'] = array();
  48.         foreach ($this->paramMap as $param) {
  49.             if (!isset($this->args[$param])) {
  50.                 continue;
  51.             }
  52.             $this->args['Context'][$param] = $this->args[$param];
  53.             unset( $this->args[$param] );
  54.         }
  55.         
  56.         $return = parent::call($session);
  57.         $this->args = $bak;
  58.  
  59.         return $return['CrossPromotions'];
  60.     }
  61. }
  62. ?>