Passed
Push — master ( 1b7a86...e4cab9 )
by Stefan
46s
created

Shipment::setShipmentTotalWeight()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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