1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalModel;
6
7 /**
8 * Class PaymentHistory
9 *
10 * List of Payments made by the seller.
11 *
12 * @package PayPal\Api
13 *
14 * @property \PayPal\Api\Payment[] payments
15 * @property int count
16 * @property string next_id
17 */
18 class PaymentHistory extends PayPalModel
19 {
20 /**
21 * A list of Payment resources
22 *
23 * @param \PayPal\Api\Payment[] $payments
24 *
25 * @return $this
26 */
27 public function setPayments($payments)
28 {
29 $this->payments = $payments;
30 return $this;
31 }
32
33 /**
34 * A list of Payment resources
35 *
36 * @return \PayPal\Api\Payment[]
37 */
38 public function getPayments()
39 {
40 return $this->payments;
41 }
42
43 /**
44 * Append Payments to the list.
45 *
46 * @param \PayPal\Api\Payment $payment
47 * @return $this
48 */
49 public function addPayment($payment)
50 {
51 if (!$this->getPayments()) {
52 return $this->setPayments(array($payment));
53 } else {
54 return $this->setPayments(
55 array_merge($this->getPayments(), array($payment))
56 );
57 }
58 }
59
60 /**
61 * Remove Payments from the list.
62 *
63 * @param \PayPal\Api\Payment $payment
64 * @return $this
65 */
66 public function removePayment($payment)
67 {
68 return $this->setPayments(
69 array_diff($this->getPayments(), array($payment))
70 );
71 }
72
73 /**
74 * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. Maximum value: 20.
75 *
76 * @param int $count
77 *
78 * @return $this
79 */
80 public function setCount($count)
81 {
82 $this->count = $count;
83 return $this;
84 }
85
86 /**
87 * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. Maximum value: 20.
88 *
89 * @return int
90 */
91 public function getCount()
92 {
93 return $this->count;
94 }
95
96 /**
97 * Identifier of the next element to get the next range of results.
98 *
99 * @param string $next_id
100 *
101 * @return $this
102 */
103 public function setNextId($next_id)
104 {
105 $this->next_id = $next_id;
106 return $this;
107 }
108
109 /**
110 * Identifier of the next element to get the next range of results.
111 *
112 * @return string
113 */
114 public function getNextId()
115 {
116 return $this->next_id;
117 }
118
119 }
120