1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalModel;
6
7 /**
8 * Class CancelNotification
9 *
10 * Email/SMS notification.
11 *
12 * @package PayPal\Api
13 *
14 * @property string subject
15 * @property string note
16 * @property bool send_to_merchant
17 * @property bool send_to_payer
18 * @property string[] cc_emails
19 */
20 class CancelNotification extends PayPalModel
21 {
22 /**
23 * Subject of the notification.
24 *
25 * @param string $subject
26 *
27 * @return $this
28 */
29 public function setSubject($subject)
30 {
31 $this->subject = $subject;
32 return $this;
33 }
34
35 /**
36 * Subject of the notification.
37 *
38 * @return string
39 */
40 public function getSubject()
41 {
42 return $this->subject;
43 }
44
45 /**
46 * Note to the payer.
47 *
48 * @param string $note
49 *
50 * @return $this
51 */
52 public function setNote($note)
53 {
54 $this->note = $note;
55 return $this;
56 }
57
58 /**
59 * Note to the payer.
60 *
61 * @return string
62 */
63 public function getNote()
64 {
65 return $this->note;
66 }
67
68 /**
69 * Indicates whether to send a copy of the notification to the merchant.
70 *
71 * @param bool $send_to_merchant
72 *
73 * @return $this
74 */
75 public function setSendToMerchant($send_to_merchant)
76 {
77 $this->send_to_merchant = $send_to_merchant;
78 return $this;
79 }
80
81 /**
82 * Indicates whether to send a copy of the notification to the merchant.
83 *
84 * @return bool
85 */
86 public function getSendToMerchant()
87 {
88 return $this->send_to_merchant;
89 }
90
91 /**
92 * Indicates whether to send a copy of the notification to the payer.
93 *
94 * @param bool $send_to_payer
95 *
96 * @return $this
97 */
98 public function setSendToPayer($send_to_payer)
99 {
100 $this->send_to_payer = $send_to_payer;
101 return $this;
102 }
103
104 /**
105 * Indicates whether to send a copy of the notification to the payer.
106 *
107 * @return bool
108 */
109 public function getSendToPayer()
110 {
111 return $this->send_to_payer;
112 }
113
114 /**
115 * Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported.
116 *
117 * @param string[] $cc_emails
118 *
119 * @return $this
120 */
121 public function setCcEmails($cc_emails)
122 {
123 $this->cc_emails = $cc_emails;
124 return $this;
125 }
126
127 /**
128 * Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported.
129 *
130 * @return string[]
131 */
132 public function getCcEmails()
133 {
134 return $this->cc_emails;
135 }
136
137 /**
138 * Append CcEmails to the list.
139 *
140 * @param string $string
141 * @return $this
142 */
143 public function addCcEmail($string)
144 {
145 if (!$this->getCcEmails()) {
146 return $this->setCcEmails(array($string));
147 } else {
148 return $this->setCcEmails(
149 array_merge($this->getCcEmails(), array($string))
150 );
151 }
152 }
153
154 /**
155 * Remove CcEmails from the list.
156 *
157 * @param string $string
158 * @return $this
159 */
160 public function removeCcEmail($string)
161 {
162 return $this->setCcEmails(
163 array_diff($this->getCcEmails(), array($string))
164 );
165 }
166
167 }
168