1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* Copyright © Eduard Sukharev |
4
|
|
|
* |
5
|
|
|
* For a license agreement, see the LICENSE file. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
|
9
|
|
|
namespace Ups\Entity; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Based on UPS Developer Guide, dated: 13 Jul 2015 |
13
|
|
|
* @author Eduard Sukharev <[email protected]> |
14
|
|
|
*/ |
15
|
|
|
class ShipmentRequestLabelSpecification |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* Required. |
19
|
|
|
* Label print method code that the labels are to be generated. For EPL2 formatted labels use EPL, for SPL formatted |
20
|
|
|
* labels use SPL, for ZPL formatted labels use ZPL, for STAR printer formatted labels use STARPL and for image |
21
|
|
|
* formats use GIF. |
22
|
|
|
* |
23
|
|
|
* @var string |
24
|
|
|
*/ |
25
|
|
|
private $printMethodCode; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Optional. |
29
|
|
|
* Label Specification Code description |
30
|
|
|
* |
31
|
|
|
* @var string |
32
|
|
|
*/ |
33
|
|
|
private $printMethodDescription; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Optional. |
37
|
|
|
* Browser HTTPUserAgent String. This is the preferred way of identifying GIF image type to be generated |
38
|
|
|
* |
39
|
|
|
* @var string |
40
|
|
|
*/ |
41
|
|
|
private $httpUserAgent; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Required for EPL2, ZPL, STARPL and SPL labels. |
45
|
|
|
* Height of the label image. For IN, use whole inches. Only valid value is 4. |
46
|
|
|
* Label Image will only scale up to 4 X 6, even when requesting 4 X 8. |
47
|
|
|
* |
48
|
|
|
* @var string |
49
|
|
|
*/ |
50
|
|
|
private $stockSizeHeight; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Required for EPL2, ZPL, STARPL and SPL labels. |
54
|
|
|
* Height of the label image. For IN, use whole inches. Only valid values are 6 or 8. |
55
|
|
|
* Label Image will only scale up to 4 X 6, even when requesting 4 X 8. |
56
|
|
|
* |
57
|
|
|
* @var string |
58
|
|
|
*/ |
59
|
|
|
private $stockSizeWidth; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Required if $printMethodCode = GIF. |
63
|
|
|
* Code type that the label image is to be generated in. |
64
|
|
|
* Valid values are GIF or PNG. Only GIF is supported on the remote server. |
65
|
|
|
* |
66
|
|
|
* @var string |
67
|
|
|
*/ |
68
|
|
|
private $imageFormatCode; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Optional. |
72
|
|
|
* Description of the label image format code. |
73
|
|
|
* |
74
|
|
|
* @var string |
75
|
|
|
*/ |
76
|
|
|
private $imageFormatDescription; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Optional. |
80
|
|
|
* For Exchange Forward Shipment, Valid values are: |
81
|
|
|
* 01 - EXCHANGE-LIKE ITEM ONLY. |
82
|
|
|
* 02 - EXCHANGE-DRIVER INSTRUCTIONS INSIDE |
83
|
|
|
* By default label will have Exchange Routing instruction Text as EXCHANGE-LIKE ITEM ONLY |
84
|
|
|
* |
85
|
|
|
* @var string |
86
|
|
|
*/ |
87
|
|
|
private $instructionCode; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Optional. |
91
|
|
|
* Description of the label Instruction code. |
92
|
|
|
* |
93
|
|
|
* @var string |
94
|
|
|
*/ |
95
|
|
|
private $instructionDescription; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* Optional. |
99
|
|
|
* Language character set expected on label. Valid values are: |
100
|
|
|
* dan = Danish (Latin-1) |
101
|
|
|
* nld = Dutch (Latin-1) |
102
|
|
|
* fin = Finnish (Latin-1) |
103
|
|
|
* fra = French (Latin-1) |
104
|
|
|
* deu = German (Latin-1) |
105
|
|
|
* itl = Italian (Latin-1) |
106
|
|
|
* nor = Norwegian (Latin-1) |
107
|
|
|
* pol = Polish (Latin-2) |
108
|
|
|
* por = Poruguese (Latin-1) |
109
|
|
|
* spa = Spanish (Latin-1) |
110
|
|
|
* swe = Swedish (Latin-1) |
111
|
|
|
* ces = Czech (Latin-2) |
112
|
|
|
* hun = Hungarian (Latin-2) |
113
|
|
|
* slk = Slovak (Latin-2) |
114
|
|
|
* rus = Russian (Cyrillic) |
115
|
|
|
* tur = Turkish (Latin-5) |
116
|
|
|
* ron = Romanian (Latin-2) |
117
|
|
|
* bul = Bulgarian (Latin-2) |
118
|
|
|
* est = Estonian (Latin-2) |
119
|
|
|
* ell = Greek (Latin-2) |
120
|
|
|
* lav = Latvian (Latin-2) |
121
|
|
|
* |
122
|
|
|
* @var string |
123
|
|
|
*/ |
124
|
|
|
private $characterSet; |
125
|
|
|
|
126
|
|
|
const PRINT_METHOD_CODE_EPL = 'EPL'; |
127
|
|
|
const PRINT_METHOD_CODE_SPL = 'SPL'; |
128
|
|
|
const PRINT_METHOD_CODE_ZPL = 'ZPL'; |
129
|
|
|
const PRINT_METHOD_CODE_STARPL = 'STARPL'; |
130
|
|
|
const PRINT_METHOD_CODE_GIF = 'GIF'; |
131
|
|
|
|
132
|
|
|
const IMG_FORMAT_CODE_GIF = 'GIF'; |
133
|
|
|
const IMG_FORMAT_CODE_PNG = 'PNG'; |
134
|
|
|
|
135
|
|
|
const INSTRUCTION_CODE_EXCHANGE_LIKE_ITEM_ONLY = '01'; |
136
|
|
|
const INSTRUCTION_CODE_EXCHANGE_DRIVER_INSTRUCTIONS_INSIDE = '02'; |
137
|
|
|
|
138
|
|
|
const CHARACTER_SET_DANISH = 'dan'; |
139
|
|
|
const CHARACTER_SET_DUTCH = 'nld'; |
140
|
|
|
const CHARACTER_SET_FINNISH = 'fin'; |
141
|
|
|
const CHARACTER_SET_FRENCH = 'fra'; |
142
|
|
|
const CHARACTER_SET_GERMAN = 'deu'; |
143
|
|
|
const CHARACTER_SET_ITALIAN = 'itl'; |
144
|
|
|
const CHARACTER_SET_NORWEGIAN = 'nor'; |
145
|
|
|
const CHARACTER_SET_POLISH = 'pol'; |
146
|
|
|
const CHARACTER_SET_PORUGUESE = 'por'; |
147
|
|
|
const CHARACTER_SET_SPANISH = 'spa'; |
148
|
|
|
const CHARACTER_SET_SWEDISH = 'swe'; |
149
|
|
|
const CHARACTER_SET_CZECH = 'ces'; |
150
|
|
|
const CHARACTER_SET_HUNGARIAN = 'hun'; |
151
|
|
|
const CHARACTER_SET_SLOVAK = 'slk'; |
152
|
|
|
const CHARACTER_SET_RUSSIAN = 'rus'; |
153
|
|
|
const CHARACTER_SET_TURKISH = 'tur'; |
154
|
|
|
const CHARACTER_SET_ROMANIAN = 'ron'; |
155
|
|
|
const CHARACTER_SET_BULGARIAN = 'bul'; |
156
|
|
|
const CHARACTER_SET_ESTONIAN = 'est'; |
157
|
|
|
const CHARACTER_SET_GREEK = 'ell'; |
158
|
|
|
const RACTER_SET_LATVIAN = 'lav'; |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* @param string $printMethodCode |
162
|
|
|
*/ |
163
|
|
|
public function __construct($printMethodCode) |
164
|
|
|
{ |
165
|
|
|
$this->printMethodCode = $printMethodCode; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @return string |
170
|
|
|
*/ |
171
|
|
|
public function getPrintMethodCode() |
172
|
|
|
{ |
173
|
|
|
return $this->printMethodCode; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* @return string |
178
|
|
|
*/ |
179
|
|
|
public function getPrintMethodDescription() |
180
|
|
|
{ |
181
|
|
|
return $this->printMethodDescription; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* @param string $printMethodDescription |
186
|
|
|
* @return ShipmentRequestLabelSpecification |
187
|
|
|
*/ |
188
|
|
|
public function setPrintMethodDescription($printMethodDescription) |
189
|
|
|
{ |
190
|
|
|
$this->printMethodDescription = $printMethodDescription; |
191
|
|
|
|
192
|
|
|
return $this; |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
/** |
196
|
|
|
* @return string |
197
|
|
|
*/ |
198
|
|
|
public function getHttpUserAgent() |
199
|
|
|
{ |
200
|
|
|
return $this->httpUserAgent; |
201
|
|
|
} |
202
|
|
|
|
203
|
|
|
/** |
204
|
|
|
* @param string $httpUserAgent |
205
|
|
|
* @return ShipmentRequestLabelSpecification |
206
|
|
|
*/ |
207
|
|
|
public function setHttpUserAgent($httpUserAgent) |
208
|
|
|
{ |
209
|
|
|
$this->httpUserAgent = $httpUserAgent; |
210
|
|
|
|
211
|
|
|
return $this; |
212
|
|
|
} |
213
|
|
|
|
214
|
|
|
/** |
215
|
|
|
* @return string |
216
|
|
|
*/ |
217
|
|
|
public function getStockSizeHeight() |
218
|
|
|
{ |
219
|
|
|
return $this->stockSizeHeight; |
220
|
|
|
} |
221
|
|
|
|
222
|
|
|
/** |
223
|
|
|
* @param string $stockSizeHeight |
224
|
|
|
* @return ShipmentRequestLabelSpecification |
225
|
|
|
*/ |
226
|
|
|
public function setStockSizeHeight($stockSizeHeight) |
227
|
|
|
{ |
228
|
|
|
$this->stockSizeHeight = $stockSizeHeight; |
229
|
|
|
|
230
|
|
|
return $this; |
231
|
|
|
} |
232
|
|
|
|
233
|
|
|
/** |
234
|
|
|
* @return string |
235
|
|
|
*/ |
236
|
|
|
public function getStockSizeWidth() |
237
|
|
|
{ |
238
|
|
|
return $this->stockSizeWidth; |
239
|
|
|
} |
240
|
|
|
|
241
|
|
|
/** |
242
|
|
|
* @param string $stockSizeWidth |
243
|
|
|
* @return ShipmentRequestLabelSpecification |
244
|
|
|
*/ |
245
|
|
|
public function setStockSizeWidth($stockSizeWidth) |
246
|
|
|
{ |
247
|
|
|
$this->stockSizeWidth = $stockSizeWidth; |
248
|
|
|
|
249
|
|
|
return $this; |
250
|
|
|
} |
251
|
|
|
|
252
|
|
|
/** |
253
|
|
|
* @return string |
254
|
|
|
*/ |
255
|
|
|
public function getImageFormatCode() |
256
|
|
|
{ |
257
|
|
|
return $this->imageFormatCode; |
258
|
|
|
} |
259
|
|
|
|
260
|
|
|
/** |
261
|
|
|
* @param string $imageFormatCode |
262
|
|
|
* @return ShipmentRequestLabelSpecification |
263
|
|
|
*/ |
264
|
|
|
public function setImageFormatCode($imageFormatCode) |
265
|
|
|
{ |
266
|
|
|
$this->imageFormatCode = $imageFormatCode; |
267
|
|
|
|
268
|
|
|
return $this; |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
/** |
272
|
|
|
* @return string |
273
|
|
|
*/ |
274
|
|
|
public function getImageFormatDescription() |
275
|
|
|
{ |
276
|
|
|
return $this->imageFormatDescription; |
277
|
|
|
} |
278
|
|
|
|
279
|
|
|
/** |
280
|
|
|
* @param string $imageFormatDescription |
281
|
|
|
* @return ShipmentRequestLabelSpecification |
282
|
|
|
*/ |
283
|
|
|
public function setImageFormatDescription($imageFormatDescription) |
284
|
|
|
{ |
285
|
|
|
$this->imageFormatDescription = $imageFormatDescription; |
286
|
|
|
|
287
|
|
|
return $this; |
288
|
|
|
} |
289
|
|
|
|
290
|
|
|
/** |
291
|
|
|
* @return string |
292
|
|
|
*/ |
293
|
|
|
public function getInstructionCode() |
294
|
|
|
{ |
295
|
|
|
return $this->instructionCode; |
296
|
|
|
} |
297
|
|
|
|
298
|
|
|
/** |
299
|
|
|
* @param string $instructionCode |
300
|
|
|
* @return ShipmentRequestLabelSpecification |
301
|
|
|
*/ |
302
|
|
|
public function setInstructionCode($instructionCode) |
303
|
|
|
{ |
304
|
|
|
$this->instructionCode = $instructionCode; |
305
|
|
|
|
306
|
|
|
return $this; |
307
|
|
|
} |
308
|
|
|
|
309
|
|
|
/** |
310
|
|
|
* @return string |
311
|
|
|
*/ |
312
|
|
|
public function getInstructionDescription() |
313
|
|
|
{ |
314
|
|
|
return $this->instructionDescription; |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
/** |
318
|
|
|
* @param string $instructionDescription |
319
|
|
|
* @return ShipmentRequestLabelSpecification |
320
|
|
|
*/ |
321
|
|
|
public function setInstructionDescription($instructionDescription) |
322
|
|
|
{ |
323
|
|
|
$this->instructionDescription = $instructionDescription; |
324
|
|
|
|
325
|
|
|
return $this; |
326
|
|
|
} |
327
|
|
|
|
328
|
|
|
/** |
329
|
|
|
* @return string |
330
|
|
|
*/ |
331
|
|
|
public function getCharacterSet() |
332
|
|
|
{ |
333
|
|
|
return $this->characterSet; |
334
|
|
|
} |
335
|
|
|
|
336
|
|
|
/** |
337
|
|
|
* @param string $characterSet |
338
|
|
|
* @return ShipmentRequestLabelSpecification |
339
|
|
|
*/ |
340
|
|
|
public function setCharacterSet($characterSet) |
341
|
|
|
{ |
342
|
|
|
$this->characterSet = $characterSet; |
343
|
|
|
return $this; |
344
|
|
|
} |
345
|
|
|
} |
346
|
|
|
|