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

Source for file ReviseItem.php

Documentation is available at ReviseItem.php

  1. <?PHP
  2. /**
  3.  * Revise (change) an item that has been added to Ebay
  4.  *
  5.  * <code>
  6.  * $item = $eBay->GetItem('12345678');
  7.  * $item->Title = 'New title';
  8.  * $eBay->ReviseItem($item);
  9.  * </code>
  10.  *
  11.  * $Id: ReviseItem.php,v 1.2 2004/10/29 21:16:50 schst Exp $
  12.  *
  13.  * @package Services_Ebay
  14.  * @author  Stephan Schmidt <schst@php.net>
  15.  */
  16. {
  17.    /**
  18.     * verb of the API call
  19.     *
  20.     * @var  string 
  21.     */
  22.     protected $verb = 'ReviseItem';
  23.  
  24.    /**
  25.     * parameter map that is used, when scalar parameters are passed
  26.     *
  27.     * @var  array 
  28.     */
  29.     protected $paramMap = array();
  30.  
  31.    /**
  32.     * constructor
  33.     *
  34.     * @param    array 
  35.     */
  36.     public function __construct($args)
  37.     {
  38.         $item $args[0];
  39.         
  40.         if (!$item instanceof Services_Ebay_Model_Item{
  41.             throw new Services_Ebay_Exception'No item passed.' );
  42.         }
  43.         
  44.         $id $item->Id;
  45.         
  46.         if (empty($id)) {
  47.             throw new Services_Ebay_Exception'Item has no ID.' );
  48.         }
  49.  
  50.         $this->args = $item->GetModifiedProperties();
  51.         if (isset($this->args['Id'])) {
  52.             throw new Services_Ebay_Exception'You must not change the item ID.' );
  53.         }
  54.         
  55.         $this->args['ItemId'$id;
  56.     }
  57.     
  58.    /**
  59.     * make the API call
  60.     *
  61.     * @param    object Services_Ebay_Session 
  62.     * @return   string 
  63.     */
  64.     public function call(Services_Ebay_Session $session)
  65.     {
  66.         $return = parent::call($session);
  67.         if (isset($return['Item'])) {
  68.             $returnItem $return['Item'];
  69.  
  70.             $this->item->Id = $returnItem['Id'];
  71.             $this->item->StartTime = $returnItem['StartTime'];
  72.             $this->item->EndTime = $returnItem['EndTime'];
  73.             $this->item->Fees = $returnItem['Fees'];
  74.         
  75.             return true;
  76.         }
  77.         return false;
  78.     }
  79. }
  80. ?>

Documentation generated on Mon, 11 Mar 2019 13:58:47 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.