Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

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