Example #1
0
 /**
  * create new item
  *
  * @param    array   properties
  */
 public function __construct($props, $session = null)
 {
     if (is_array($props) && isset($props['Seller'])) {
         $props['Seller'] = \Services\Ebay::loadModel('User', $props['Seller'], $session);
     }
     parent::__construct($props, $session);
 }
Example #2
0
 /**
  * create a new item list
  *
  * @param    array   properties
  * @param    object \Services\Ebay\Session
  */
 public function __construct($props, $session = null)
 {
     if (isset($props['CustomCategories']) && isset($props['CustomCategories']['Category'])) {
         if (isset($props['CustomCategories']['Category'][0])) {
             $this->categories = $props['CustomCategories']['Category'];
         } else {
             $this->categories = array($props['CustomCategories']['Category']);
         }
         unset($props['CustomCategories']);
     }
     parent::__construct($props, $session);
 }
Example #3
0
 /**
  * create new model
  *
  * @param    array
  * @param    object
  */
 public function __construct($props, $session = null)
 {
     if (isset($props['AccountEntry'])) {
         $entries = $props['AccountEntry'];
         unset($props['AccountEntry']);
         if (isset($entries[0])) {
             $this->entries = $entries;
         } else {
             $this->entries = array($entries);
         }
     }
     parent::__construct($props, $session);
 }
 /**
  * create new feedback model
  *
  * @param    array   feedback
  */
 public function __construct($transactions, $session = null)
 {
     if (isset($transactions['Transactions']['Transaction'])) {
         if (!isset($transactions['Transactions']['Transaction'][0])) {
             $transactions['Transactions']['Transaction'] = array($transactions['Transactions']['Transaction']);
         }
         foreach ($transactions['Transactions']['Transaction'] as $tmp) {
             array_push($this->transactions, \Services\Ebay::loadModel('Transaction', $tmp, $session));
         }
         unset($transactions['Transactions']);
     }
     parent::__construct($transactions);
 }
Example #5
0
 /**
  * constructor
  *
  * @param    array
  */
 public function __construct($props, $session = null)
 {
     if (!empty($props)) {
         if (isset($props[0])) {
             foreach ($props as $tmp) {
                 $this->messages[] = $tmp['DisputeMessage']['MessageText'];
             }
         } else {
             $this->messages = array($messages['DisputeMessage']['MessageText']);
         }
     }
     parent::__construct($props, $session);
 }
Example #6
0
 /**
  * create a new list of disputes
  *
  * @param    array   return value from GetUserDisputes
  * @param    \Services\Ebay\Session
  */
 public function __construct($props, \Services\Ebay\Session $session = null)
 {
     if (isset($props['DisputeArray'])) {
         $disputes = $props['DisputeArray'];
         unset($props['DisputeArray']);
         if (isset($disputes['Dispute'][0])) {
             $this->disputes = $disputes['Dispute'];
         } else {
             $this->disputes = array($disputes['Dispute']);
         }
     }
     parent::__construct($props, $session);
 }
Example #7
0
 /**
  * create new feedback model
  *
  * @param    array   feedback
  */
 public function __construct($bids, $session = null)
 {
     $this->count = (int) $bids['Bids']['Count'];
     if (isset($bids['Bids']['Bid'])) {
         if (!isset($bids['Bids']['Bid'][0])) {
             $bids['Bids']['Bid'] = array($bids['Bids']['Bid']);
         }
         foreach ($bids['Bids']['Bid'] as $tmp) {
             array_push($this->bids, \Services\Ebay::loadModel('Bid', $tmp, $session));
         }
         unset($bids['Bids']);
     }
     parent::__construct($bids);
 }
Example #8
0
 /**
  * creates an array for serialization
  *
  * @return   array
  */
 public function toArray()
 {
     $array = parent::toArray();
     if (!empty($this->preferences)) {
         $array['Preference'] = $this->preferences;
     }
     if (!empty($this->preferenceSets)) {
         $array['Preferences'] = array();
         foreach ($this->preferenceSets as $set) {
             array_push($array['Preferences'], $set->toArray());
         }
     }
     return $array;
 }
Example #9
0
 /**
  * create a new item list
  *
  * @param    array   properties
  * @param    object \Services\Ebay\Session
  */
 public function __construct($props, $session = null)
 {
     if (isset($props['ItemArray'])) {
         if (is_array($props['ItemArray'])) {
             if (!isset($props['ItemArray']['Item'][0])) {
                 $props['ItemArray']['Item'] = array($props['ItemArray']['Item']);
             }
             foreach ($props['ItemArray']['Item'] as $item) {
                 array_push($this->items, \Services\Ebay::loadModel('Item', $item, $session));
             }
         }
         unset($props['ItemArray']);
     }
     parent::__construct($props, $session);
 }
 /**
  * create new feedback model
  *
  * @param    array   feedback
  */
 public function __construct($messages, $session = null)
 {
     $this->moreItems = $messages['HasMoreItems'] == 'false' ? false : true;
     $this->pages = (int) $messages['PaginationResult']['TotalNumberOfPages'];
     $this->entries = (int) $messages['PaginationResult']['TotalNumberOfEntries'];
     if (isset($messages['MemberMessage'])) {
         if (!isset($messages['MemberMessage'][0])) {
             $messages['MemberMessage'] = array($messages['MemberMessage']);
         }
         foreach ($messages['MemberMessage'] as $tmp) {
             array_push($this->messages, \Services\Ebay::loadModel('MemberMessage', $tmp, $session));
         }
         unset($messages['MemberMessage']);
     }
     parent::__construct($messages);
 }
Example #11
0
 /**
  * create new model
  *
  * @param    array
  * @param    object
  */
 public function __construct($props, $session = null)
 {
     if (isset($props['SearchResultItemArray']['SearchResultItem'])) {
         $items = $props['SearchResultItemArray']['SearchResultItem'];
         unset($props['SearchResultItemArray']['SearchResultItem']);
         if (isset($items[0])) {
             $items = $items;
         } else {
             $items = array($items);
         }
         foreach ($items as $tmp) {
             array_push($this->items, \Services\Ebay::loadModel('Item', $tmp['Item'], $session));
         }
     }
     parent::__construct($props, $session);
 }
Example #12
0
 /**
  * create a new order
  *
  * @param    array
  * @param    object
  */
 public function __construct($props, $session = null)
 {
     parent::__construct($props, $session);
     $this->properties['TransactionArray'] = array('Transaction' => array());
     $this->properties['ShippingDetails'] = array('ShippingServiceOptions' => array(), 'InternationalShippingServiceOption' => array(), 'SalesTax' => array());
 }
Example #13
0
 /**
  * Constructor
  *
  * @param array     $props  properties
  * @param \Services\Ebay\Session $session    session
  * @param integer   $DetailLevel    detail-level
  */
 public function __construct($props, $session = null, $DetailLevel = 0)
 {
     parent::__construct($props, $session, $DetailLevel);
     $this->user = \Services\Ebay::loadModel('User', $props['User'], $session);
     unset($this->properties['User']);
 }