1: <?php
2: /*
3: * This class was auto-generated from the API references found at
4: * https://apireference.connect.worldline-solutions.com/
5: */
6: namespace Worldline\Connect\Sdk\V1\Domain;
7:
8: use UnexpectedValueException;
9: use Worldline\Connect\Sdk\Domain\DataObject;
10:
11: /**
12: * @package Worldline\Connect\Sdk\V1\Domain
13: */
14: class Dispute extends DataObject
15: {
16: /**
17: * @var string
18: */
19: public $captureId = null;
20:
21: /**
22: * @var DisputeOutput
23: */
24: public $disputeOutput = null;
25:
26: /**
27: * @var string
28: */
29: public $id = null;
30:
31: /**
32: * @var string
33: */
34: public $paymentId = null;
35:
36: /**
37: * @var string
38: */
39: public $status = null;
40:
41: /**
42: * @var DisputeStatusOutput
43: */
44: public $statusOutput = null;
45:
46: /**
47: * @return object
48: */
49: public function toObject()
50: {
51: $object = parent::toObject();
52: if (!is_null($this->captureId)) {
53: $object->captureId = $this->captureId;
54: }
55: if (!is_null($this->disputeOutput)) {
56: $object->disputeOutput = $this->disputeOutput->toObject();
57: }
58: if (!is_null($this->id)) {
59: $object->id = $this->id;
60: }
61: if (!is_null($this->paymentId)) {
62: $object->paymentId = $this->paymentId;
63: }
64: if (!is_null($this->status)) {
65: $object->status = $this->status;
66: }
67: if (!is_null($this->statusOutput)) {
68: $object->statusOutput = $this->statusOutput->toObject();
69: }
70: return $object;
71: }
72:
73: /**
74: * @param object $object
75: * @return $this
76: * @throws UnexpectedValueException
77: */
78: public function fromObject($object)
79: {
80: parent::fromObject($object);
81: if (property_exists($object, 'captureId')) {
82: $this->captureId = $object->captureId;
83: }
84: if (property_exists($object, 'disputeOutput')) {
85: if (!is_object($object->disputeOutput)) {
86: throw new UnexpectedValueException('value \'' . print_r($object->disputeOutput, true) . '\' is not an object');
87: }
88: $value = new DisputeOutput();
89: $this->disputeOutput = $value->fromObject($object->disputeOutput);
90: }
91: if (property_exists($object, 'id')) {
92: $this->id = $object->id;
93: }
94: if (property_exists($object, 'paymentId')) {
95: $this->paymentId = $object->paymentId;
96: }
97: if (property_exists($object, 'status')) {
98: $this->status = $object->status;
99: }
100: if (property_exists($object, 'statusOutput')) {
101: if (!is_object($object->statusOutput)) {
102: throw new UnexpectedValueException('value \'' . print_r($object->statusOutput, true) . '\' is not an object');
103: }
104: $value = new DisputeStatusOutput();
105: $this->statusOutput = $value->fromObject($object->statusOutput);
106: }
107: return $this;
108: }
109: }
110: