home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Services / Ebay / Model / DisputeList.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  1.2 KB  |  49 lines

  1. <?PHP
  2. /**
  3.  * Model for a list of eBay disputes
  4.  *
  5.  *
  6.  * @package Services_Ebay
  7.  * @author  Stephan Schmidt <schst@php.net>
  8.  */
  9. class Services_Ebay_Model_DisputeList extends Services_Ebay_Model implements IteratorAggregate
  10. {
  11.    /**
  12.     * container for disputes
  13.     *
  14.     * @var  array
  15.     */
  16.     private $disputes = array();
  17.     
  18.    /**
  19.     * create a new list of disputes
  20.     *
  21.     * @param    array   return value from GetUserDisputes
  22.     * @param    Services_Ebay_Session
  23.     */
  24.     public function __construct($props, $session = null)
  25.     {
  26.         if (isset($props['Disputes'])) {
  27.             $disputes = $props['Disputes'];
  28.             unset($props['Disputes']);
  29.             if (isset($disputes['Dispute'][0])) {
  30.                 $this->disputes = $disputes['Dispute'];
  31.             } else {
  32.                 $this->disputes = array($disputes['Dispute']);
  33.             }
  34.         }
  35.         parent::__construct($props, $session);
  36.     }
  37.     
  38.    /**
  39.     * iterate through the disputes
  40.     *
  41.     * @return   object
  42.     */
  43.     public function getIterator()
  44.     {
  45.         $it = new ArrayObject($this->disputes);
  46.         return $it;
  47.     }
  48. }
  49. ?>