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$
  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.     * options that will be passed to the serializer
  35.     *
  36.     * @var  array 
  37.     */
  38.     protected $serializerOptions = array(
  39.                                             'mode' => 'simplexml'
  40.                                         );
  41.    /**
  42.     * constructor
  43.     *
  44.     * @param    array 
  45.     */
  46.     public function __construct($args)
  47.     {
  48.         $item $args[0];
  49.         
  50.         if (!$item instanceof Services_Ebay_Model_Item{
  51.             throw new Services_Ebay_Exception'No item passed.' );
  52.         }
  53.         
  54.         $id $item->Id;
  55.         
  56.         if (empty($id)) {
  57.             throw new Services_Ebay_Exception'Item has no ID.' );
  58.         }
  59.  
  60.         $this->args = $item->GetModifiedProperties();
  61.         if (isset($this->args['Id'])) {
  62.             throw new Services_Ebay_Exception'You must not change the item ID.' );
  63.         }
  64.         
  65.         $this->args['ItemID'$id;
  66.     }
  67.     
  68.    /**
  69.     * make the API call
  70.     *
  71.     * @param    object Services_Ebay_Session 
  72.     * @return   string 
  73.     */
  74.     public function call(Services_Ebay_Session $session)
  75.     {
  76.         $return = parent::call($session);
  77.         if (isset($return['Item'])) {
  78.             $returnItem $return['Item'];
  79.  
  80.             $this->item->Id = $returnItem['Id'];
  81.             $this->item->StartTime = $returnItem['StartTime'];
  82.             $this->item->EndTime = $returnItem['EndTime'];
  83.             $this->item->Fees = $returnItem['Fees'];
  84.         
  85.             return true;
  86.         }
  87.         return false;
  88.     }
  89. }
  90. ?>

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