1: | <?php |
2: | |
3: | |
4: | |
5: | namespace Worldline\Acquiring\Sdk\V1\Domain; |
6: | |
7: | use UnexpectedValueException; |
8: | use Worldline\Acquiring\Sdk\Domain\DataObject; |
9: | |
10: | |
11: | |
12: | |
13: | class ApiPaymentErrorResponse extends DataObject |
14: | { |
15: | |
16: | |
17: | |
18: | public $detail = null; |
19: | |
20: | |
21: | |
22: | |
23: | public $instance = null; |
24: | |
25: | |
26: | |
27: | |
28: | public $status = null; |
29: | |
30: | |
31: | |
32: | |
33: | public $title = null; |
34: | |
35: | |
36: | |
37: | |
38: | public $type = null; |
39: | |
40: | |
41: | |
42: | |
43: | public function toObject() |
44: | { |
45: | $object = parent::toObject(); |
46: | if (!is_null($this->detail)) { |
47: | $object->detail = $this->detail; |
48: | } |
49: | if (!is_null($this->instance)) { |
50: | $object->instance = $this->instance; |
51: | } |
52: | if (!is_null($this->status)) { |
53: | $object->status = $this->status; |
54: | } |
55: | if (!is_null($this->title)) { |
56: | $object->title = $this->title; |
57: | } |
58: | if (!is_null($this->type)) { |
59: | $object->type = $this->type; |
60: | } |
61: | return $object; |
62: | } |
63: | |
64: | |
65: | |
66: | |
67: | |
68: | |
69: | public function fromObject($object) |
70: | { |
71: | parent::fromObject($object); |
72: | if (property_exists($object, 'detail')) { |
73: | $this->detail = $object->detail; |
74: | } |
75: | if (property_exists($object, 'instance')) { |
76: | $this->instance = $object->instance; |
77: | } |
78: | if (property_exists($object, 'status')) { |
79: | $this->status = $object->status; |
80: | } |
81: | if (property_exists($object, 'title')) { |
82: | $this->title = $object->title; |
83: | } |
84: | if (property_exists($object, 'type')) { |
85: | $this->type = $object->type; |
86: | } |
87: | return $this; |
88: | } |
89: | } |
90: | |