1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalModel;
6
7 /**
8 * Class Notification
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 string[] cc_emails
18 */
19 class Notification extends PayPalModel
20 {
21 /**
22 * Subject of the notification.
23 *
24 * @param string $subject
25 *
26 * @return $this
27 */
28 public function setSubject($subject)
29 {
30 $this->subject = $subject;
31 return $this;
32 }
33
34 /**
35 * Subject of the notification.
36 *
37 * @return string
38 */
39 public function getSubject()
40 {
41 return $this->subject;
42 }
43
44 /**
45 * Note to the payer.
46 *
47 * @param string $note
48 *
49 * @return $this
50 */
51 public function setNote($note)
52 {
53 $this->note = $note;
54 return $this;
55 }
56
57 /**
58 * Note to the payer.
59 *
60 * @return string
61 */
62 public function getNote()
63 {
64 return $this->note;
65 }
66
67 /**
68 * Indicates whether to send a copy of the email to the merchant.
69 *
70 * @param bool $send_to_merchant
71 *
72 * @return $this
73 */
74 public function setSendToMerchant($send_to_merchant)
75 {
76 $this->send_to_merchant = $send_to_merchant;
77 return $this;
78 }
79
80 /**
81 * Indicates whether to send a copy of the email to the merchant.
82 *
83 * @return bool
84 */
85 public function getSendToMerchant()
86 {
87 return $this->send_to_merchant;
88 }
89
90 /**
91 * 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.
92 *
93 * @param string[] $cc_emails
94 *
95 * @return $this
96 */
97 public function setCcEmails($cc_emails)
98 {
99 $this->cc_emails = $cc_emails;
100 return $this;
101 }
102
103 /**
104 * 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.
105 *
106 * @return string[]
107 */
108 public function getCcEmails()
109 {
110 return $this->cc_emails;
111 }
112
113 /**
114 * Append CcEmails to the list.
115 *
116 * @param string $string
117 * @return $this
118 */
119 public function addCcEmail($string)
120 {
121 if (!$this->getCcEmails()) {
122 return $this->setCcEmails(array($string));
123 } else {
124 return $this->setCcEmails(
125 array_merge($this->getCcEmails(), array($string))
126 );
127 }
128 }
129
130 /**
131 * Remove CcEmails from the list.
132 *
133 * @param string $string
134 * @return $this
135 */
136 public function removeCcEmail($string)
137 {
138 return $this->setCcEmails(
139 array_diff($this->getCcEmails(), array($string))
140 );
141 }
142
143 }
144