Completed
Pull Request — master (#149)
by
unknown
22:27
created

Shipment::setReturnService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Ups\Entity;
4
5
class Shipment
6
{
7
    /**
8
     * @var PaymentInformation
9
     */
10
    private $paymentInformation;
11
12
    /**
13
     * @var ItemizedPaymentInformation
14
     */
15
    private $itemizedPaymentInformation;
16
17
    /**
18
     * @var RateInformation
19
     */
20
    private $rateInformation;
21
22
    /**
23
     * @var string
24
     */
25
    private $description;
26
27
    /**
28
     * @var Shipper
29
     */
30
    private $shipper;
31
32
    /**
33
     * @var ShipTo;
34
     */
35
    private $shipTo;
36
37
    /**
38
     * @var SoldTo
39
     */
40
    private $soldTo;
41
42
    /**
43
     * @var ShipFrom
44
     */
45
    private $shipFrom;
46
47
    /**
48
     * @var AlternateDeliveryAddress
49
     */
50
    private $alternateDeliveryAddress;
51
52
    /**
53
     * @var ShipmentIndicationType
54
     */
55
    private $shipmentIndicationType;
56
57
    /**
58
     * @var Service
59
     */
60
    private $service;
61
62
    /**
63
     * @var ReturnService
64
     */
65
    private $returnService;
66
67
    /**
68
     * @var bool
69
     */
70
    private $documentsOnly;
71
72
    /**
73
     * @var Package[]
74
     */
75
    private $packages = [];
76
77
    /**
78
     * @var ReferenceNumber
79
     */
80
    private $referenceNumber;
81
    
82
    /**
83
     * @var ReferenceNumber
84
     */
85
    private $referenceNumber2;
86
87
    /**
88
     * @var ShipmentServiceOptions
89
     */
90
    private $shipmentServiceOptions;
91
92
    /**
93
     * @var bool
94
     */
95
    private $goodsNotInFreeCirculationIndicator;
96
97
    /**
98
     * @var string
99
     */
100
    private $movementReferenceNumber;
101
102
    /**
103
     * @var InvoiceLineTotal
104
     */
105
    private $invoiceLineTotal;
106
107
    /**
108
     * @var string
109
     */
110
    private $numOfPiecesInShipment;
111
112 3
    public function __construct()
113
    {
114 3
        $this->setShipper(new Shipper());
115 3
        $this->setShipTo(new ShipTo());
116 3
        $this->setShipmentServiceOptions(new ShipmentServiceOptions());
117 3
        $this->setService(new Service());
118 3
        $this->rateInformation = null;
119 3
    }
120
121
    /**
122
     * @return ShipmentIndicationType
123
     */
124
    public function getShipmentIndicationType()
125
    {
126
        return $this->shipmentIndicationType;
127
    }
128
129
    /**
130
     * @param ShipmentIndicationType $shipmentIndicationType
131
     */
132
    public function setShipmentIndicationType(ShipmentIndicationType $shipmentIndicationType)
133
    {
134
        $this->shipmentIndicationType = $shipmentIndicationType;
135
    }
136
137
    /**
138
     * @return AlternateDeliveryAddress
139
     */
140
    public function getAlternateDeliveryAddress()
141
    {
142
        return $this->alternateDeliveryAddress;
143
    }
144
145
    /**
146
     * @param AlternateDeliveryAddress $alternateDeliveryAddress
147
     */
148
    public function setAlternateDeliveryAddress(AlternateDeliveryAddress $alternateDeliveryAddress)
149
    {
150
        $this->alternateDeliveryAddress = $alternateDeliveryAddress;
151
    }
152
153
    /**
154
     * @param Package $package
155
     *
156
     * @return Shipment
157
     */
158
    public function addPackage(Package $package)
159
    {
160
        $packages = $this->getPackages();
161
        $packages[] = $package;
162
        $this->setPackages($packages);
163
164
        return $this;
165
    }
166
167
    /**
168
     * @return string
169
     */
170
    public function getDescription()
171
    {
172
        return $this->description;
173
    }
174
175
    /**
176
     * @param string $description
177
     *
178
     * @return Shipment
179
     */
180
    public function setDescription($description)
181
    {
182
        $this->description = $description;
183
184
        return $this;
185
    }
186
187
    /**
188
     * @param ReferenceNumber $referenceNumber
189
     *
190
     * @return Shipment
191
     */
192
    public function setReferenceNumber(ReferenceNumber $referenceNumber)
193
    {
194
        $this->referenceNumber = $referenceNumber;
195
196
        return $this;
197
    }
198
    
199
    /**
200
     * @param ReferenceNumber $referenceNumber
201
     *
202
     * @return Shipment
203
     */
204
    public function setReferenceNumber2(ReferenceNumber $referenceNumber)
205
    {
206
        $this->referenceNumber2 = $referenceNumber;
207
208
        return $this;
209
    }
210
211
    /**
212
     * @return ReferenceNumber
213
     */
214
    public function getReferenceNumber()
215
    {
216
        return $this->referenceNumber;
217
    }
218
    
219
    /**
220
     * @return ReferenceNumber
221
     */
222
    public function getReferenceNumber2()
223
    {
224
        return $this->referenceNumber2;
225
    }
226
227
    /**
228
     * @return bool
229
     */
230
    public function getDocumentsOnly()
231
    {
232
        return $this->documentsOnly;
233
    }
234
235
    /**
236
     * @param bool $documentsOnly
237
     *
238
     * @return Shipment
239
     */
240
    public function setDocumentsOnly($documentsOnly)
241
    {
242
        $this->documentsOnly = $documentsOnly;
243
244
        return $this;
245
    }
246
247
    /**
248
     * @return Package[]
249
     */
250
    public function getPackages()
251
    {
252
        return $this->packages;
253
    }
254
255
    /**
256
     * @param Package[] $packages
257
     *
258
     * @return Shipment
259
     */
260
    public function setPackages(array $packages)
261
    {
262
        $this->packages = $packages;
263
264
        return $this;
265
    }
266
267
    /**
268
     * @return Service
269
     */
270
    public function getService()
271
    {
272
        return $this->service;
273
    }
274
275
    /**
276
     * @param Service $service
277
     *
278
     * @return Shipment
279
     */
280 3
    public function setService(Service $service)
281
    {
282 3
        $this->service = $service;
283
284 3
        return $this;
285
    }
286
287
    /**
288
     * @return ReturnService
289
     */
290
    public function getReturnService()
291
    {
292
        return $this->returnService;
293
    }
294
295
    /**
296
     * @param ReturnService $returnService
297
     *
298
     * @return Shipment
299
     */
300
    public function setReturnService(ReturnService $returnService)
301
    {
302
        $this->returnService = $returnService;
303
304
        return $this;
305
    }
306
307
    /**
308
     * @return ShipFrom
309
     */
310
    public function getShipFrom()
311
    {
312
        return $this->shipFrom;
313
    }
314
315
    /**
316
     * @param ShipFrom $shipFrom
317
     *
318
     * @return Shipment
319
     */
320
    public function setShipFrom(ShipFrom $shipFrom)
321
    {
322
        $this->shipFrom = $shipFrom;
323
324
        return $this;
325
    }
326
327
    /**
328
     * @return ShipTo
329
     */
330
    public function getShipTo()
331
    {
332
        return $this->shipTo;
333
    }
334
335
    /**
336
     * @param ShipTo $shipTo
337
     *
338
     * @return Shipment
339
     */
340 3
    public function setShipTo(ShipTo $shipTo)
341
    {
342 3
        $this->shipTo = $shipTo;
343
344 3
        return $this;
345
    }
346
347
    /**
348
     * @return SoldTo
349
     */
350
    public function getSoldTo()
351
    {
352
        return $this->soldTo;
353
    }
354
355
    /**
356
     * @param SoldTo $soldTo
357
     *
358
     * @return Shipment
359
     */
360
    public function setSoldTo(SoldTo $soldTo)
361
    {
362
        $this->soldTo = $soldTo;
363
364
        return $this;
365
    }
366
367
    /**
368
     * @return ShipmentServiceOptions
369
     */
370
    public function getShipmentServiceOptions()
371
    {
372
        return $this->shipmentServiceOptions;
373
    }
374
375
    /**
376
     * @param ShipmentServiceOptions $shipmentServiceOptions
377
     *
378
     * @return Shipment
379
     */
380 3
    public function setShipmentServiceOptions(ShipmentServiceOptions $shipmentServiceOptions)
381
    {
382 3
        $this->shipmentServiceOptions = $shipmentServiceOptions;
383
384 3
        return $this;
385
    }
386
387
    /**
388
     * @return Shipper
389
     */
390
    public function getShipper()
391
    {
392
        return $this->shipper;
393
    }
394
395
    /**
396
     * @param Shipper $shipper
397
     *
398
     * @return Shipment
399
     */
400 3
    public function setShipper(Shipper $shipper)
401
    {
402 3
        $this->shipper = $shipper;
403
404 3
        return $this;
405
    }
406
407
    /**
408
     * @return PaymentInformation
409
     */
410
    public function getPaymentInformation()
411
    {
412
        return $this->paymentInformation;
413
    }
414
415
    /**
416
     * @param PaymentInformation $paymentInformation
417
     *
418
     * @return Shipment
419
     */
420
    public function setPaymentInformation(PaymentInformation $paymentInformation)
421
    {
422
        $this->paymentInformation = $paymentInformation;
423
        $this->itemizedPaymentInformation = null;
424
425
        return $this;
426
    }
427
428
    /**
429
     * @return ItemizedPaymentInformation
430
     */
431
    public function getItemizedPaymentInformation()
432
    {
433
        return $this->itemizedPaymentInformation;
434
    }
435
436
    /**
437
     * @param ItemizedPaymentInformation $itemizedPaymentInformation
438
     *
439
     * @return Shipment
440
     */
441
    public function setItemizedPaymentInformation(ItemizedPaymentInformation $itemizedPaymentInformation)
442
    {
443
        $this->itemizedPaymentInformation = $itemizedPaymentInformation;
444
        $this->paymentInformation = null;
445
446
        return $this;
447
    }
448
449
    /**
450
     * If called, returned prices will include negotiated rates (discounts will be applied).
451
     */
452
    public function showNegotiatedRates()
453
    {
454
        $this->rateInformation = new RateInformation();
455
        $this->rateInformation->setNegotiatedRatesIndicator(true);
456
    }
457
458
    /**
459
     * @return null|RateInformation
460
     */
461
    public function getRateInformation()
462
    {
463
        return $this->rateInformation;
464
    }
465
466
    /**
467
     * @param RateInformation $rateInformation
468
     *
469
     * @return Shipment
470
     */
471
    public function setRateInformation(RateInformation $rateInformation)
472
    {
473
        $this->rateInformation = $rateInformation;
474
475
        return $this;
476
    }
477
478
    /**
479
     * @return boolean
480
     */
481
    public function getGoodsNotInFreeCirculationIndicator()
482
    {
483
        return $this->goodsNotInFreeCirculationIndicator;
484
    }
485
486
    /**
487
     * @param boolean $goodsNotInFreeCirculationIndicator
488
     * @return Shipment
489
     */
490
    public function setGoodsNotInFreeCirculationIndicator($goodsNotInFreeCirculationIndicator)
491
    {
492
        $this->goodsNotInFreeCirculationIndicator = $goodsNotInFreeCirculationIndicator;
493
494
        return $this;
495
    }
496
497
    /**
498
     * @return string
499
     */
500
    public function getMovementReferenceNumber()
501
    {
502
        return $this->movementReferenceNumber;
503
    }
504
505
    /**
506
     * @param string $movementReferenceNumber
507
     * @return Shipment
508
     */
509
    public function setMovementReferenceNumber($movementReferenceNumber)
510
    {
511
        $this->movementReferenceNumber = $movementReferenceNumber;
512
513
        return $this;
514
    }
515
516
    /**
517
     * @return InvoiceLineTotal
518
     */
519
    public function getInvoiceLineTotal()
520
    {
521
        return $this->invoiceLineTotal;
522
    }
523
524
    /**
525
     * @param InvoiceLineTotal $invoiceLineTotal
526
     * @return Shipment
527
     */
528
    public function setInvoiceLineTotal(InvoiceLineTotal $invoiceLineTotal)
529
    {
530
        $this->invoiceLineTotal = $invoiceLineTotal;
531
532
        return $this;
533
    }
534
535
    /**
536
     * @return string
537
     */
538
    public function getNumOfPiecesInShipment()
539
    {
540
        return $this->numOfPiecesInShipment;
541
    }
542
543
    /**
544
     * @param string $numOfPiecesInShipment
545
     * @return Shipment
546
     */
547
    public function setNumOfPiecesInShipment($numOfPiecesInShipment)
548
    {
549
        $this->numOfPiecesInShipment = $numOfPiecesInShipment;
550
551
        return $this;
552
    }
553
}
554