BulkSubmissionEmailParameters.php
5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<?php
/**
* Entity to pass bulk export submission parameters
*
* Provides a guarantee that any requested or required parameters have a known
* default value and type
*
*/
class NF_Exports_BulkSubmissionEmailParameters {
/**
* Form ID
* @var int
*/
protected $formId;
/**
* Comma-delimited email 'To' addresses
* @var string
*/
protected $emailTo;
/**
* Email 'From' address
* @var string
*/
protected $emailFrom;
/**
* Email 'Reply To' address
* @var string
*/
protected $emailReplyTo;
/**
* Email 'Subject'
* @var string
*/
protected $emailSubject;
/**
* Output format - e.g. CSV, PDF
* @var string
*/
protected $format;
/**
* Get output format
* @return string
*/
public function getFormat() {
return $this->format;
}
/**
* Get form Id
* @return int
*/
public function getFormId() {
return $this->formId;
}
/**
* Get Email `To` addresses string - comma delimited
* @return string
*/
public function getEmailTo() {
if (!isset($this->emailTo)) {
return '';
}
return $this->emailTo;
}
/**
* Get Email `From` address
* @return string
*/
public function getEmailFrom() {
if (!isset($this->emailFrom)) {
return '';
}
return $this->emailFrom;
}
/**
* Get Email `Reply To` address
* @return string
*/
public function getEmailReplyTo() {
if (!isset($this->emailReplyTo)) {
return '';
}
return $this->emailReplyTo;
}
/**
* Get Email `Subject`
* @return string
*/
public function getEmailSubject() {
if (!isset($this->emailSubject)) {
return '';
}
return $this->emailSubject;
}
/**
* Set Email `To` addresses - comma delimited
*
* @param string $emailTo
* @return $this
*/
public function setEmailTo($emailTo) {
$this->emailTo = $emailTo;
return $this;
}
/**
* Set Email `From` address
* @param string $emailFrom
* @return $this
*/
public function setEmailFrom($emailFrom) {
$this->emailFrom = $emailFrom;
return $this;
}
/**
* Set Email `Reply To` address
* @param string $emailReplyTo
* @return $this
*/
public function setEmailReplyTo($emailReplyTo) {
$this->emailReplyTo = $emailReplyTo;
return $this;
}
/**
* Set Email `Subject` address
* @param string $emailSubject
* @return $this
*/
public function setEmailSubject($emailSubject) {
$this->emailSubject = $emailSubject;
return $this;
}
/**
* Set form Id
* @param int $formId
* @return NF_Database_Models_SubmissionExportSettingsParameters
*/
public function setFormId($formId) {
$this->formId = $formId;
return $this;
}
/**
* Set output format
*
* @param string $format
* @return NF_Database_Models_SubmissionExportSettingsParameters
*/
public function setFormat($format) {
$this->format = $format;
return $this;
}
/**
* Convert instance to associative array
* @return array
*/
public function toArray()/* : array */ {
$vars = get_object_vars($this);
$array = [];
foreach ($vars as $property => $value) {
if (is_object($value) && is_callable([$value, 'toArray'])) {
$value = $value->toArray();
}
$array[$property] = $value;
}
return $array;
}
/**
* Instantiate instance from associative array
*
* @param array $items
* @return NF_Database_Models_SubmissionCollectionInterfaceParameters
*/
public static function fromArray(array $items)/* : NF_Database_Models_SubmissionCollectionInterfaceParameters */ {
$obj = new static();
foreach ($items as $property => $value) {
$obj = $obj->__set($property, $value);
}
return $obj;
}
/**
* Magic method to return property
*
* @param string $name
* @return mixed
*/
public function __get($name) {
$getter = 'get' . ucfirst($name);
if (method_exists($this, $getter)) {
return call_user_func([$this, $getter]);
}
if (property_exists($this, $name)) {
return $this->$name;
}
}
/**
*
* @param string $name
* @param mixed $value
* @return NF_Database_Models_SubmissionCollectionInterfaceParameters
*/
public function __set($name, $value)/* : NF_Database_Models_SubmissionCollectionInterfaceParameters */ {
$setter = 'set' . ucfirst($name);
if (method_exists($this, $setter)) {
return call_user_func([$this, $setter], $value);
}
if (property_exists($this, $name)) {
$this->$name = $value;
return $this;
}
return $this;
}
}