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.3 2004/12/14 19:08:25 schst Exp $
  12.  *
  13.  * @package Services_Ebay
  14.  * @author  Stephan Schmidt <schst@php.net>
  15.  * @link    http://developer.ebay.com/DevZone/docs/API_Doc/Functions/ReviseItem/ReviseItemLogic.htm
  16.  * @see     Services_Ebay_Model_Item::Revise()
  17.  */
  18. {
  19.    /**
  20.     * verb of the API call
  21.     *
  22.     * @var  string 
  23.     */
  24.     protected $verb = 'ReviseItem';
  25.  
  26.    /**
  27.     * parameter map that is used, when scalar parameters are passed
  28.     *
  29.     * @var  array 
  30.     */
  31.     protected $paramMap = array();
  32.  
  33.    /**
  34.     * constructor
  35.     *
  36.     * @param    array 
  37.     */
  38.     public function __construct($args)
  39.     {
  40.         $item $args[0];
  41.         
  42.         if (!$item instanceof Services_Ebay_Model_Item{
  43.             throw new Services_Ebay_Exception'No item passed.' );
  44.         }
  45.         
  46.         $id $item->Id;
  47.         
  48.         if (empty($id)) {
  49.             throw new Services_Ebay_Exception'Item has no ID.' );
  50.         }
  51.  
  52.         $this->args = $item->GetModifiedProperties();
  53.         if (isset($this->args['Id'])) {
  54.             throw new Services_Ebay_Exception'You must not change the item ID.' );
  55.         }
  56.         
  57.         $this->args['ItemId'$id;
  58.     }
  59.     
  60.    /**
  61.     * make the API call
  62.     *
  63.     * @param    object Services_Ebay_Session 
  64.     * @return   string 
  65.     */
  66.     public function call(Services_Ebay_Session $session)
  67.     {
  68.         $return = parent::call($session);
  69.         if (isset($return['Item'])) {
  70.             $returnItem $return['Item'];
  71.  
  72.             $this->item->Id = $returnItem['Id'];
  73.             $this->item->StartTime = $returnItem['StartTime'];
  74.             $this->item->EndTime = $returnItem['EndTime'];
  75.             $this->item->Fees = $returnItem['Fees'];
  76.         
  77.             return true;
  78.         }
  79.         return false;
  80.     }
  81. }
  82. ?>

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