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

Source for file User.php

Documentation is available at User.php

  1. <?PHP
  2. /**
  3.  * Model for an eBay user
  4.  *
  5.  *
  6.  * @package Services_Ebay
  7.  * @author  Stephan Schmidt <schst@php.net>
  8.  */
  9. {
  10.    /**
  11.     * model type
  12.     *
  13.     * @var  string 
  14.     */
  15.     protected $type = 'User';
  16.  
  17.    /**
  18.     * property that stores the unique identifier (=pk) of the model
  19.     *
  20.     * @var string 
  21.     */
  22.     protected $primaryKey = 'UserId';
  23.  
  24.     /**
  25.     * get the feedback for the user
  26.     *
  27.     * @param    int     Detail Level
  28.     * @param    int     starting page
  29.     * @param    int     items per page
  30.     * @link     http://developer.ebay.com/DevZone/docs/API_Doc/Functions/GetFeedback/GetFeedback.htm
  31.     */
  32.     public function GetFeedback($DetailLevel = Services_Ebay::FEEDBACK_BRIEF$StartingPage = 1$ItemsPerPage = 25)
  33.     {
  34.         $args = array(
  35.                        'UserId'       => $this->properties['UserId'],
  36.                        'StartingPage' => $StartingPage,
  37.                        'ItemsPerPage' => $ItemsPerPage,
  38.                        'DetailLevel'  => $DetailLevel
  39.                     );
  40.         $call Services_Ebay::loadAPICall('GetFeedback');
  41.         $call->setArgs($args);
  42.         
  43.         return $call->call($this->session);
  44.     }
  45.     
  46.    /**
  47.     * get the list of items the user is selling
  48.     *
  49.     * @param    array   all arguments
  50.     * @link     http://developer.ebay.com/DevZone/docs/API_Doc/Functions/GetSellerList/GetSellerList.htm
  51.     */
  52.     public function GetSellerList($args = array())
  53.     {
  54.         $defaultArgs = array(
  55.                        'UserId'       => $this->properties['UserId'],
  56.                        'DetailLevel'  => 16
  57.                     );
  58.         $args array_merge($defaultArgs$args);
  59.         $call Services_Ebay::loadAPICall('GetSellerList');
  60.         $call->setArgs($args);
  61.         
  62.         return $call->call($this->session);
  63.     }
  64.  
  65.    /**
  66.     * get list of items on which the user is/has been bidding
  67.     *
  68.     * @link     http://developer.ebay.com/DevZone/docs/API_Doc/Functions/GetBidderList/GetBidderList.htm
  69.     */
  70.     public function GetBidderList($Active = 1$DetailLevel = 32$Days = null$EndTimeFrom = null$EndTimeTo = null)
  71.     {
  72.         $args = array(
  73.                        'UserId'       => $this->properties['UserId'],
  74.                        'Active'       => $Active,
  75.                        'DetailLevel'  => 32,
  76.                        'Days'         => $Days,
  77.                        'EndTimeFrom'  => $EndTimeFrom,
  78.                        'EndTimeTo'    => $EndTimeTo
  79.                     );
  80.         $call Services_Ebay::loadAPICall('GetBidderList');
  81.         $call->setArgs($args);
  82.         
  83.         return $call->call($this->session);
  84.     }
  85.  
  86.    /**
  87.     * leave feedback for the user
  88.     *
  89.     * @param    array   all arguments
  90.     * @link     http://developer.ebay.com/DevZone/docs/API_Doc/Functions/LeaveFeedback/LeaveFeedbackLogic.htm
  91.     */
  92.     public function LeaveFeedback($ItemId$CommentType$Comment$TransactionId = null)
  93.     {
  94.         $args = array(
  95.                        'TargetUser'   => $this->properties['UserId'],
  96.                        'ItemId'       => $ItemId,
  97.                        'CommentType'  => $CommentType,
  98.                        'Comment'      => $Comment
  99.                     );
  100.         if (!is_null($TransactionId)) {
  101.             $args['TransactionId'$TransactionId;
  102.         }
  103.         $call Services_Ebay::loadAPICall('LeaveFeedback');
  104.         $call->setArgs($args);
  105.         
  106.         return $call->call($this->session);
  107.     }
  108.  
  109.    /**
  110.     * get the user from eBay
  111.     *
  112.     * Use this to query by a previously set user id
  113.     *
  114.     * <code>
  115.     * $user = Services_Ebay::loadModel('User', 'superman-74', $session);
  116.     * $user->Get();
  117.     * </code>
  118.     *
  119.     * @param    string    ItemId
  120.     * @see      Services_Ebay_Call_GetUser
  121.     */
  122.     public function Get($ItemId = null)
  123.     {
  124.         $args = array(
  125.                         'UserId' => $this->properties['UserId'],
  126.                         'ItemId' => $ItemId
  127.                     );
  128.  
  129.         $call Services_Ebay::loadAPICall('GetUser');
  130.         $call->setArgs($args);
  131.         
  132.         $tmp $call->call($this->session);
  133.         $this->properties     = $tmp->toArray();
  134.         $this->eBayProperties = $this->properties;
  135.         unset($tmp);
  136.         return true;
  137.     }
  138. }
  139. ?>

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