1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalModel;
6
7 /**
8 * Class InvoiceSearchResponse
9 *
10 *
11 *
12 * @package PayPal\Api
13 *
14 * @property int total_count
15 * @property \PayPal\Api\Invoice[] invoices
16 */
17 class InvoiceSearchResponse extends PayPalModel
18 {
19 /**
20 * Total number of invoices.
21 *
22 * @param int $total_count
23 *
24 * @return $this
25 */
26 public function setTotalCount($total_count)
27 {
28 $this->total_count = $total_count;
29 return $this;
30 }
31
32 /**
33 * Total number of invoices.
34 *
35 * @return int
36 */
37 public function getTotalCount()
38 {
39 return $this->total_count;
40 }
41
42 /**
43 * List of invoices belonging to a merchant.
44 *
45 * @param \PayPal\Api\Invoice[] $invoices
46 *
47 * @return $this
48 */
49 public function setInvoices($invoices)
50 {
51 $this->invoices = $invoices;
52 return $this;
53 }
54
55 /**
56 * List of invoices belonging to a merchant.
57 *
58 * @return \PayPal\Api\Invoice[]
59 */
60 public function getInvoices()
61 {
62 return $this->invoices;
63 }
64
65 /**
66 * Append Invoices to the list.
67 *
68 * @param \PayPal\Api\Invoice $invoice
69 * @return $this
70 */
71 public function addInvoice($invoice)
72 {
73 if (!$this->getInvoices()) {
74 return $this->setInvoices(array($invoice));
75 } else {
76 return $this->setInvoices(
77 array_merge($this->getInvoices(), array($invoice))
78 );
79 }
80 }
81
82 /**
83 * Remove Invoices from the list.
84 *
85 * @param \PayPal\Api\Invoice $invoice
86 * @return $this
87 */
88 public function removeInvoice($invoice)
89 {
90 return $this->setInvoices(
91 array_diff($this->getInvoices(), array($invoice))
92 );
93 }
94
95 }
96