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.                        'Pagination'   => array
  37.                                                 'StartingPage' => $StartingPage,
  38.                                                 'EntriesPerPage' => $ItemsPerPage
  39.                                               ),
  40.                        'DetailLevel'  => 'ReturnAll'
  41.                     );
  42.         $call Services_Ebay::loadAPICall('GetFeedback');
  43.         $call->setArgs($args);
  44.         
  45.         return $call->call($this->session);
  46.     }
  47.     
  48.    /**
  49.     * get the list of items the user is selling
  50.     *
  51.     * @param    array   all arguments
  52.     * @link     http://developer.ebay.com/DevZone/docs/API_Doc/Functions/GetSellerList/GetSellerList.htm
  53.     */
  54.     public function GetSellerList($args = array())
  55.     {
  56.         $defaultArgs = array(
  57.                        'UserId'       => $this->properties['UserId'],
  58.                        'DetailLevel'  => 16
  59.                     );
  60.         $args array_merge($defaultArgs$args);
  61.         $call Services_Ebay::loadAPICall('GetSellerList');
  62.         $call->setArgs($args);
  63.         
  64.         return $call->call($this->session);
  65.     }
  66.  
  67.    /**
  68.     * get list of items on which the user is/has been bidding
  69.     *
  70.     * @link     http://developer.ebay.com/DevZone/docs/API_Doc/Functions/GetBidderList/GetBidderList.htm
  71.     */
  72.     public function GetBidderList($Active = true$DetailLevel 'ReturnAll'$EndTimeFrom = null$EndTimeTo = null)
  73.     {
  74.         $args = array(
  75.                        'UserID'             => $this->properties['UserID'],
  76.                        'ActiveItemsOnly'    => $Active,
  77.                        'DetailLevel'        => 'ReturnAll',
  78.                        'EndTimeFrom'        => $EndTimeFrom,
  79.                        'EndTimeTo'          => $EndTimeTo
  80.                     );
  81.         $call Services_Ebay::loadAPICall('GetBidderList');
  82.         $call->setArgs($args);
  83.         
  84.         return $call->call($this->session);
  85.     }
  86.  
  87.    /**
  88.     * leave feedback for the user
  89.     *
  90.     * @param    array   all arguments
  91.     * @link     http://developer.ebay.com/DevZone/docs/API_Doc/Functions/LeaveFeedback/LeaveFeedbackLogic.htm
  92.     */
  93.     public function LeaveFeedback($ItemId$CommentType$Comment$TransactionId = null)
  94.     {
  95.         $args = array(
  96.                        'TargetUser'   => $this->properties['UserId'],
  97.                        'ItemId'       => $ItemId,
  98.                        'CommentType'  => $CommentType,
  99.                        'Comment'      => $Comment
  100.                     );
  101.         if (!is_null($TransactionId)) {
  102.             $args['TransactionId'$TransactionId;
  103.         }
  104.         $call Services_Ebay::loadAPICall('LeaveFeedback');
  105.         $call->setArgs($args);
  106.         
  107.         return $call->call($this->session);
  108.     }
  109.  
  110.    /**
  111.     * get the user from eBay
  112.     *
  113.     * Use this to query by a previously set user id
  114.     *
  115.     * <code>
  116.     * $user = Services_Ebay::loadModel('User', 'superman-74', $session);
  117.     * $user->Get();
  118.     * </code>
  119.     *
  120.     * @param    string    ItemId
  121.     * @see      Services_Ebay_Call_GetUser
  122.     */
  123.     public function Get($ItemId = null)
  124.     {
  125.         $args = array(
  126.                         'UserId' => $this->properties['UserId'],
  127.                         'ItemId' => $ItemId
  128.                     );
  129.  
  130.         $call Services_Ebay::loadAPICall('GetUser');
  131.         $call->setArgs($args);
  132.         
  133.         $tmp $call->call($this->session);
  134.         $this->properties     = $tmp->toArray();
  135.         $this->eBayProperties = $this->properties;
  136.         unset($tmp);
  137.         return true;
  138.     }
  139. }
  140. ?>

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