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: | class FraudResults extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $fraudServiceResult = null; |
20: | |
21: | |
22: | |
23: | |
24: | public $inAuth = null; |
25: | |
26: | |
27: | |
28: | |
29: | public $microsoftFraudProtection = null; |
30: | |
31: | |
32: | |
33: | |
34: | public function toObject() |
35: | { |
36: | $object = parent::toObject(); |
37: | if (!is_null($this->fraudServiceResult)) { |
38: | $object->fraudServiceResult = $this->fraudServiceResult; |
39: | } |
40: | if (!is_null($this->inAuth)) { |
41: | $object->inAuth = $this->inAuth->toObject(); |
42: | } |
43: | if (!is_null($this->microsoftFraudProtection)) { |
44: | $object->microsoftFraudProtection = $this->microsoftFraudProtection->toObject(); |
45: | } |
46: | return $object; |
47: | } |
48: | |
49: | |
50: | |
51: | |
52: | |
53: | |
54: | public function fromObject($object) |
55: | { |
56: | parent::fromObject($object); |
57: | if (property_exists($object, 'fraudServiceResult')) { |
58: | $this->fraudServiceResult = $object->fraudServiceResult; |
59: | } |
60: | if (property_exists($object, 'inAuth')) { |
61: | if (!is_object($object->inAuth)) { |
62: | throw new UnexpectedValueException('value \'' . print_r($object->inAuth, true) . '\' is not an object'); |
63: | } |
64: | $value = new InAuth(); |
65: | $this->inAuth = $value->fromObject($object->inAuth); |
66: | } |
67: | if (property_exists($object, 'microsoftFraudProtection')) { |
68: | if (!is_object($object->microsoftFraudProtection)) { |
69: | throw new UnexpectedValueException('value \'' . print_r($object->microsoftFraudProtection, true) . '\' is not an object'); |
70: | } |
71: | $value = new MicrosoftFraudResults(); |
72: | $this->microsoftFraudProtection = $value->fromObject($object->microsoftFraudProtection); |
73: | } |
74: | return $this; |
75: | } |
76: | } |
77: | |