1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalModel;
6
7 /**
8 * Class PayoutBatch
9 *
10 * The PayPal-generated batch status.
11 *
12 * @package PayPal\Api
13 *
14 * @property \PayPal\Api\PayoutBatchHeader batch_header
15 * @property \PayPal\Api\PayoutItemDetails[] items
16 * @property \PayPal\Api\Links[] links
17 */
18 class PayoutBatch extends PayPalModel
19 {
20 /**
21 * A batch header. Includes the generated batch status.
22 *
23 * @param \PayPal\Api\PayoutBatchHeader $batch_header
24 *
25 * @return $this
26 */
27 public function setBatchHeader($batch_header)
28 {
29 $this->batch_header = $batch_header;
30 return $this;
31 }
32
33 /**
34 * A batch header. Includes the generated batch status.
35 *
36 * @return \PayPal\Api\PayoutBatchHeader
37 */
38 public function getBatchHeader()
39 {
40 return $this->batch_header;
41 }
42
43 /**
44 * An array of items in a batch payout.
45 *
46 * @param \PayPal\Api\PayoutItemDetails[] $items
47 *
48 * @return $this
49 */
50 public function setItems($items)
51 {
52 $this->items = $items;
53 return $this;
54 }
55
56 /**
57 * An array of items in a batch payout.
58 *
59 * @return \PayPal\Api\PayoutItemDetails[]
60 */
61 public function getItems()
62 {
63 return $this->items;
64 }
65
66 /**
67 * Append Items to the list.
68 *
69 * @param \PayPal\Api\PayoutItemDetails $payoutItemDetails
70 * @return $this
71 */
72 public function addItem($payoutItemDetails)
73 {
74 if (!$this->getItems()) {
75 return $this->setItems(array($payoutItemDetails));
76 } else {
77 return $this->setItems(
78 array_merge($this->getItems(), array($payoutItemDetails))
79 );
80 }
81 }
82
83 /**
84 * Remove Items from the list.
85 *
86 * @param \PayPal\Api\PayoutItemDetails $payoutItemDetails
87 * @return $this
88 */
89 public function removeItem($payoutItemDetails)
90 {
91 return $this->setItems(
92 array_diff($this->getItems(), array($payoutItemDetails))
93 );
94 }
95
96
97 /**
98 * Sets Links
99 *
100 * @param \PayPal\Api\Links[] $links
101 *
102 * @return $this
103 */
104 public function setLinks($links)
105 {
106 $this->links = $links;
107 return $this;
108 }
109
110 /**
111 * Gets Links
112 *
113 * @return \PayPal\Api\Links[]
114 */
115 public function getLinks()
116 {
117 return $this->links;
118 }
119
120 }
121