Passed
Push — master ( 17c5f7...cb633b )
by Stefan
04:29 queued 02:00
created

Shipment::getShipmentServiceOptions()   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 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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 string
104
     */
105
    private $numOfPiecesInShipment;
106
107
    /**
108
     * @var DeliveryTimeInformation
109
     */
110
    private $deliveryTimeInformation;
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
424
        return $this;
425
    }
426
427
    /**
428
     * If called, returned prices will include negotiated rates (discounts will be applied).
429
     */
430
    public function showNegotiatedRates()
431
    {
432
        $this->rateInformation = new RateInformation();
433
        $this->rateInformation->setNegotiatedRatesIndicator(true);
434
    }
435
436
    /**
437
     * @return null|RateInformation
438
     */
439
    public function getRateInformation()
440
    {
441
        return $this->rateInformation;
442
    }
443
444
    /**
445
     * @param RateInformation $rateInformation
446
     *
447
     * @return Shipment
448
     */
449
    public function setRateInformation(RateInformation $rateInformation)
450
    {
451
        $this->rateInformation = $rateInformation;
452
453
        return $this;
454
    }
455
456
    /**
457
     * @return boolean
458
     */
459
    public function getGoodsNotInFreeCirculationIndicator()
460
    {
461
        return $this->goodsNotInFreeCirculationIndicator;
462
    }
463
464
    /**
465
     * @param boolean $goodsNotInFreeCirculationIndicator
466
     * @return Shipment
467
     */
468
    public function setGoodsNotInFreeCirculationIndicator($goodsNotInFreeCirculationIndicator)
469
    {
470
        $this->goodsNotInFreeCirculationIndicator = $goodsNotInFreeCirculationIndicator;
471
472
        return $this;
473
    }
474
475
    /**
476
     * @return string
477
     */
478
    public function getMovementReferenceNumber()
479
    {
480
        return $this->movementReferenceNumber;
481
    }
482
483
    /**
484
     * @param string $movementReferenceNumber
485
     * @return Shipment
486
     */
487
    public function setMovementReferenceNumber($movementReferenceNumber)
488
    {
489
        $this->movementReferenceNumber = $movementReferenceNumber;
490
491
        return $this;
492
    }
493
494
    /**
495
     * @return InvoiceLineTotal
496
     */
497
    public function getInvoiceLineTotal()
498
    {
499
        return $this->invoiceLineTotal;
500
    }
501
502
    /**
503
     * @param InvoiceLineTotal $invoiceLineTotal
504
     * @return Shipment
505
     */
506
    public function setInvoiceLineTotal(InvoiceLineTotal $invoiceLineTotal)
507
    {
508
        $this->invoiceLineTotal = $invoiceLineTotal;
509
510
        return $this;
511
    }
512
513
    /**
514
     * @return string
515
     */
516
    public function getNumOfPiecesInShipment()
517
    {
518
        return $this->numOfPiecesInShipment;
519
    }
520
521
    /**
522
     * @param string $numOfPiecesInShipment
523
     * @return Shipment
524
     */
525
    public function setNumOfPiecesInShipment($numOfPiecesInShipment)
526
    {
527
        $this->numOfPiecesInShipment = $numOfPiecesInShipment;
528
529
        return $this;
530
    }
531
532
    /**
533
     * @return DeliveryTimeInformation
534
     */
535
    public function getDeliveryTimeInformation()
536
    {
537
        return $this->deliveryTimeInformation;
538
    }
539
540
    /**
541
     * @param DeliveryTimeInformation $deliveryTimeInformation
542
     */
543
    public function setDeliveryTimeInformation(DeliveryTimeInformation $deliveryTimeInformation)
544
    {
545
        $this->deliveryTimeInformation = $deliveryTimeInformation;
546
    }
547
}
548