/
Store.php
47 lines (45 loc) · 1.15 KB
/
Store.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?PHP
/**
* Model for an eBay store
*
* @package Services_Ebay
* @author Stephan Schmidt <schst@php.net>
*/
class Services_Ebay_Model_Store extends Services_Ebay_Model implements IteratorAggregate
{
/**
* available item lists
*
* @var array
*/
private $categories = array();
/**
* create a new item list
*
* @param array properties
* @param object Services_Ebay_Session
*/
public function __construct($props, $session = null)
{
if (isset($props['CustomCategories']) && isset($props['CustomCategories']['Category'])) {
if (isset($props['CustomCategories']['Category'][0])) {
$this->categories = $props['CustomCategories']['Category'];
} else {
$this->categories = array($props['CustomCategories']['Category']);
}
unset($props['CustomCategories']);
}
parent::__construct($props, $session);
}
/**
* get the iterator for the items in the list
*
* @return object
*/
public function getIterator()
{
$iterator = new ArrayObject($this->categories);
return $iterator;
}
}
?>