1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | namespace Worldline\Connect\Sdk\V1\Domain; |
7: | |
8: | use UnexpectedValueException; |
9: | use Worldline\Connect\Sdk\Domain\DataObject; |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | class FraudFieldsShippingDetails extends DataObject |
16: | { |
17: | |
18: | |
19: | |
20: | |
21: | public $methodDetails = null; |
22: | |
23: | |
24: | |
25: | |
26: | |
27: | public $methodSpeed = null; |
28: | |
29: | |
30: | |
31: | |
32: | |
33: | public $methodType = null; |
34: | |
35: | |
36: | |
37: | |
38: | public function toObject() |
39: | { |
40: | $object = parent::toObject(); |
41: | if (!is_null($this->methodDetails)) { |
42: | $object->methodDetails = $this->methodDetails; |
43: | } |
44: | if (!is_null($this->methodSpeed)) { |
45: | $object->methodSpeed = $this->methodSpeed; |
46: | } |
47: | if (!is_null($this->methodType)) { |
48: | $object->methodType = $this->methodType; |
49: | } |
50: | return $object; |
51: | } |
52: | |
53: | |
54: | |
55: | |
56: | |
57: | |
58: | public function fromObject($object) |
59: | { |
60: | parent::fromObject($object); |
61: | if (property_exists($object, 'methodDetails')) { |
62: | $this->methodDetails = $object->methodDetails; |
63: | } |
64: | if (property_exists($object, 'methodSpeed')) { |
65: | $this->methodSpeed = $object->methodSpeed; |
66: | } |
67: | if (property_exists($object, 'methodType')) { |
68: | $this->methodType = $object->methodType; |
69: | } |
70: | return $this; |
71: | } |
72: | } |
73: | |