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

Source for file ItemList.php

Documentation is available at ItemList.php

  1. <?PHP
  2. /**
  3.  * Model for a item list
  4.  *
  5.  * @package Services_Ebay
  6.  * @author  Stephan Schmidt <schst@php.net>
  7.  */
  8. class Services_Ebay_Model_ItemList extends Services_Ebay_Model implements IteratorAggregate
  9. {
  10.    /**
  11.     * items of the list
  12.     *
  13.     * @var  array 
  14.     */
  15.     private $items = array();
  16.  
  17.    /**
  18.     * create a new item list
  19.     *
  20.     * @param    array   properties
  21.     * @param    object Services_Ebay_Session 
  22.     */
  23.     public function __construct($props$session = null)
  24.     {
  25.         if (isset($props['ItemArray'])) {
  26.             if is_array($props['ItemArray'])) {
  27.                 if (!isset($props['ItemArray']['Item'][0])) {
  28.                     $props['ItemArray']['Item'= array($props['ItemArray']['Item']);
  29.                 }
  30.                 foreach ($props['ItemArray']['Item'as $item{
  31.                     array_push$this->itemsServices_Ebay::loadModel('Item'$item$session) );
  32.                 }
  33.             }
  34.             unset($props['ItemArray']);
  35.         }
  36.     
  37.         parent::__construct($props$session);
  38.     }
  39.  
  40.    /**
  41.     * get the iterator for the items in the list
  42.     *
  43.     * @return   object 
  44.     */
  45.     public function getIterator()
  46.     {
  47.         $iterator = new ArrayObject($this->items);
  48.         return $iterator;
  49.     }
  50. }
  51. ?>

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