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