/
Feedback.php
65 lines (61 loc) · 1.4 KB
/
Feedback.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?PHP
/**
* Model for a eBay feedback
*
*
* @package Services_Ebay
* @author Stephan Schmidt <schst@php.net>
*/
class Services_Ebay_Model_Feedback extends Services_Ebay_Model implements IteratorAggregate
{
/**
* property that stores the unique identifier (=pk) of the model
*
* @var string
*/
protected $primaryKey = 'FeedbackId';
/**
* feedback items
*
* @var array
*/
private $items = array();
/**
* create new feedback model
*
* @param array feedback
*/
public function __construct($feedback, $session = null)
{
if (isset($feedback['FeedbackDetailArray'])) {
foreach ($feedback['FeedbackDetailArray'] as $tmp) {
array_push($this->items, Services_Ebay::loadModel('FeedbackEntry', $tmp, $session));
}
unset($feedback['FeedbackDetailArray']);
}
parent::__construct($feedback);
}
/**
* get one entry of the feedback list
*
* @param int
* @return object Services_Ebay_Model_FeedbackEntry
*/
public function getEntry($pos)
{
if (isset($this->items[$pos])) {
return $this->items[$pos];
}
return false;
}
/**
* iterate through the feedback items
*
* @return array
*/
public function getIterator()
{
return new ArrayObject($this->items);
}
}
?>