1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalResourceModel;
6
7 /**
8 * Class CreditCardList
9 *
10 * A list of Credit Card Resources
11 *
12 * @package PayPal\Api
13 *
14 * @property \PayPal\Api\CreditCard[] items
15 * @property \PayPal\Api\Links[] links
16 * @property int total_items
17 * @property int total_pages
18 */
19 class CreditCardList extends PayPalResourceModel
20 {
21 /**
22 * A list of credit card resources
23 *
24 * @param \PayPal\Api\CreditCard[] $items
25 *
26 * @return $this
27 */
28 public function setItems($items)
29 {
30 $this->items = $items;
31 return $this;
32 }
33
34 /**
35 * A list of credit card resources
36 *
37 * @return \PayPal\Api\CreditCard[]
38 */
39 public function getItems()
40 {
41 return $this->items;
42 }
43
44 /**
45 * Append Items to the list.
46 *
47 * @param \PayPal\Api\CreditCard $creditCard
48 * @return $this
49 */
50 public function addItem($creditCard)
51 {
52 if (!$this->getItems()) {
53 return $this->setItems(array($creditCard));
54 } else {
55 return $this->setItems(
56 array_merge($this->getItems(), array($creditCard))
57 );
58 }
59 }
60
61 /**
62 * Remove Items from the list.
63 *
64 * @param \PayPal\Api\CreditCard $creditCard
65 * @return $this
66 */
67 public function removeItem($creditCard)
68 {
69 return $this->setItems(
70 array_diff($this->getItems(), array($creditCard))
71 );
72 }
73
74 /**
75 * Total number of items present in the given list. Note that the number of items might be larger than the records in the current page.
76 *
77 * @param int $total_items
78 *
79 * @return $this
80 */
81 public function setTotalItems($total_items)
82 {
83 $this->total_items = $total_items;
84 return $this;
85 }
86
87 /**
88 * Total number of items present in the given list. Note that the number of items might be larger than the records in the current page.
89 *
90 * @return int
91 */
92 public function getTotalItems()
93 {
94 return $this->total_items;
95 }
96
97 /**
98 * Total number of pages that exist, for the total number of items, with the given page size.
99 *
100 * @param int $total_pages
101 *
102 * @return $this
103 */
104 public function setTotalPages($total_pages)
105 {
106 $this->total_pages = $total_pages;
107 return $this;
108 }
109
110 /**
111 * Total number of pages that exist, for the total number of items, with the given page size.
112 *
113 * @return int
114 */
115 public function getTotalPages()
116 {
117 return $this->total_pages;
118 }
119
120 }
121