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 store
4
 *
5
 * @package Services_Ebay
6
 * @author  Stephan Schmidt <schst@php.net>
7
 */
8
class Services_Ebay_Model_Store extends Services_Ebay_Model implements IteratorAggregate
9
{
10
   /**
11
    * available item lists
12
    *
13
    * @var  array
14
    */
15
    private $categories = 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['CustomCategories']) && isset($props['CustomCategories']['Category'])) {
26
        	if (isset($props['CustomCategories']['Category'][0])) {
27
        	    $this->categories = $props['CustomCategories']['Category'];
28
        	} else {
29
        	    $this->categories = array($props['CustomCategories']['Category']);
30
        	}
31
        	unset($props['CustomCategories']);
32
        }
33
        parent::__construct($props, $session);
34
    }
35
 
36
   /**
37
    * get the iterator for the items in the list
38
    *
39
    * @return   object
40
    */
41
    public function getIterator()
42
    {
43
        $iterator = new ArrayObject($this->categories);
44
        return $iterator;
45
    }
46
}
47
?>