SubmissionExtraHandlerResponse.php
3.59 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
<?php
namespace NinjaForms\Includes\Entities;
use NinjaForms\Includes\Entities\SimpleEntity;
/**
* Defines data passed from SubmissionHandlers to submissions page NF>=3.6.1
*/
class SubmissionExtraHandlerResponse extends SimpleEntity
{
/**
* Response type - 'none' or `download`
*
* @var string
*/
protected $responseType = '';
/**
* Base 64 encoded downloadable string
*
* @var string
*/
protected $download = '';
/**
* Application type of download (for constructing download)
*
* @var string
*/
protected $blobType = '';
/**
* Result of request (usu. 'ok' or failure message)
*
* @var string
*/
protected $result = '';
/**
* Filename of the download, including file extension
*
* @var string
*/
protected $filename = '';
/**
* Construct entity from associative array
*
* @param array $items
* @return SubmissionExtraHandlerResponse
*/
public static function fromArray(array $items): SubmissionExtraHandlerResponse
{
$obj = new static();
foreach ($items as $property => $value) {
$obj = $obj->__set($property, $value);
}
return $obj;
}
/**
* Get response type
*
* @return string
*/
public function getResponseType(): string
{
return $this->responseType;
}
/**
* Set response type
*
* @param string $responseType Response type
*
* @return SubmissionExtraHandlerResponse
*/
public function setResponseType(string $responseType): SubmissionExtraHandlerResponse
{
$this->responseType = $responseType;
return $this;
}
/**
* Get download
*
* @return string
*/
public function getDownload(): string
{
return $this->download;
}
/**
* Set download
*
* @param string $download Download
*
* @return SubmissionExtraHandlerResponse
*/
public function setDownload(string $download): SubmissionExtraHandlerResponse
{
$this->download = $download;
return $this;
}
/**
* Get blob type
*
* @return string
*/
public function getBlobType(): string
{
return $this->blobType;
}
/**
* Set blob type
*
* @param string $blobType Blob type
*
* @return SubmissionExtraHandlerResponse
*/
public function setBlobType(string $blobType): SubmissionExtraHandlerResponse
{
$this->blobType = $blobType;
return $this;
}
/**
* Get result
*
* @return string
*/
public function getResult(): string
{
return $this->result;
}
/**
* Set result
*
* @param string $result Result
*
* @return SubmissionExtraHandlerResponse
*/
public function setResult(string $result): SubmissionExtraHandlerResponse
{
$this->result = $result;
return $this;
}
/**
* Get filename of the download, including file extension
*
* @return string
*/
public function getFilename():string
{
return $this->filename;
}
/**
* Set filename of the download, including file extension
*
* @param string $filename Filename of the download, including file extension
*
* @return SubmissionExtraHandlerResponse
*/
public function setFilename(string $filename):SubmissionExtraHandlerResponse
{
$this->filename = $filename;
return $this;
}
}