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

Source for file TransactionList.php

Documentation is available at TransactionList.php

  1. <?PHP
  2. /**
  3.  * Model for a list of transactions
  4.  *
  5.  * $Id$
  6.  *
  7.  * @package Services_Ebay
  8.  * @author  Stephan Schmidt <schst@php.net>
  9.  * @todo    improve handling of transactions (possibly store the itemId in each transaction object)
  10.  * @todo    build seller object
  11.  */
  12. class Services_Ebay_Model_TransactionList extends Services_Ebay_Model implements IteratorAggregate
  13. {
  14.    /**
  15.     * transactions
  16.     *
  17.     * @var  array 
  18.     */
  19.     private $transactions = array();
  20.     
  21.    /**
  22.     * create new feedback model
  23.     *
  24.     * @param    array   feedback
  25.     */
  26.     public function __construct($transactions$session = null)
  27.     {
  28.         if (isset($transactions['Transactions']['Transaction'])) {
  29.             if (!isset($transactions['Transactions']['Transaction'][0])) {
  30.                 $transactions['Transactions']['Transaction'= array$transactions['Transactions']['Transaction');
  31.             }
  32.             foreach ($transactions['Transactions']['Transaction'as $tmp{
  33.                 array_push($this->transactionsServices_Ebay::loadModel('Transaction'$tmp$session));
  34.             }
  35.             unset($transactions['Transactions']);
  36.         }
  37.         parent::__construct($transactions);
  38.     }
  39.     
  40.    /**
  41.     * iterate through the transactions
  42.     *
  43.     * @return array 
  44.     */
  45.     public function getIterator()
  46.     {
  47.         return new ArrayObject($this->transactions);
  48.     }
  49. }
  50. ?>

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