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 APIError extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $category = null; |
20: | |
21: | |
22: | |
23: | |
24: | public $code = null; |
25: | |
26: | |
27: | |
28: | |
29: | public $httpStatusCode = null; |
30: | |
31: | |
32: | |
33: | |
34: | public $id = null; |
35: | |
36: | |
37: | |
38: | |
39: | public $message = null; |
40: | |
41: | |
42: | |
43: | |
44: | public $propertyName = null; |
45: | |
46: | |
47: | |
48: | |
49: | public $requestId = null; |
50: | |
51: | |
52: | |
53: | |
54: | public function toObject() |
55: | { |
56: | $object = parent::toObject(); |
57: | if (!is_null($this->category)) { |
58: | $object->category = $this->category; |
59: | } |
60: | if (!is_null($this->code)) { |
61: | $object->code = $this->code; |
62: | } |
63: | if (!is_null($this->httpStatusCode)) { |
64: | $object->httpStatusCode = $this->httpStatusCode; |
65: | } |
66: | if (!is_null($this->id)) { |
67: | $object->id = $this->id; |
68: | } |
69: | if (!is_null($this->message)) { |
70: | $object->message = $this->message; |
71: | } |
72: | if (!is_null($this->propertyName)) { |
73: | $object->propertyName = $this->propertyName; |
74: | } |
75: | if (!is_null($this->requestId)) { |
76: | $object->requestId = $this->requestId; |
77: | } |
78: | return $object; |
79: | } |
80: | |
81: | |
82: | |
83: | |
84: | |
85: | |
86: | public function fromObject($object) |
87: | { |
88: | parent::fromObject($object); |
89: | if (property_exists($object, 'category')) { |
90: | $this->category = $object->category; |
91: | } |
92: | if (property_exists($object, 'code')) { |
93: | $this->code = $object->code; |
94: | } |
95: | if (property_exists($object, 'httpStatusCode')) { |
96: | $this->httpStatusCode = $object->httpStatusCode; |
97: | } |
98: | if (property_exists($object, 'id')) { |
99: | $this->id = $object->id; |
100: | } |
101: | if (property_exists($object, 'message')) { |
102: | $this->message = $object->message; |
103: | } |
104: | if (property_exists($object, 'propertyName')) { |
105: | $this->propertyName = $object->propertyName; |
106: | } |
107: | if (property_exists($object, 'requestId')) { |
108: | $this->requestId = $object->requestId; |
109: | } |
110: | return $this; |
111: | } |
112: | } |
113: | |