1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalModel;
6
7 /**
8 * Class BankAccountsList
9 *
10 * A list of Bank Account Resources
11 *
12 * @package PayPal\Api
13 *
14 * @property \PayPal\Api\BankAccount[] bank_accounts
15 * @property int count
16 * @property string next_id
17 */
18 class BankAccountsList extends PayPalModel
19 {
20 /**
21 * A list of bank account resources
22 *
23 * @param \PayPal\Api\BankAccount[] $bank_accounts
24 *
25 * @return $this
26 */
27 public function setBankAccounts($bank_accounts)
28 {
29 $this->{"bank-accounts"} = $bank_accounts;
30 return $this;
31 }
32
33 /**
34 * A list of bank account resources
35 *
36 * @return \PayPal\Api\BankAccount[]
37 */
38 public function getBankAccounts()
39 {
40 return $this->{"bank-accounts"};
41 }
42
43 /**
44 * Append BankAccounts to the list.
45 *
46 * @param \PayPal\Api\BankAccount $bankAccount
47 * @return $this
48 */
49 public function addBankAccount($bankAccount)
50 {
51 if (!$this->getBankAccounts()) {
52 return $this->setBankAccounts(array($bankAccount));
53 } else {
54 return $this->setBankAccounts(
55 array_merge($this->getBankAccounts(), array($bankAccount))
56 );
57 }
58 }
59
60 /**
61 * Remove BankAccounts from the list.
62 *
63 * @param \PayPal\Api\BankAccount $bankAccount
64 * @return $this
65 */
66 public function removeBankAccount($bankAccount)
67 {
68 return $this->setBankAccounts(
69 array_diff($this->getBankAccounts(), array($bankAccount))
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.
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.
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