1: <?php
2: /*
3: * This file was automatically generated.
4: */
5: namespace Worldline\Acquiring\Sdk\V1\Domain;
6:
7: use UnexpectedValueException;
8:
9: /**
10: * @package Worldline\Acquiring\Sdk\V1\Domain
11: */
12: class DisputeEntryWithDisputeSummary extends DisputeEntry
13: {
14: /**
15: * @var string|null
16: */
17: public ?string $disputeId = null;
18:
19: /**
20: * @var DisputeSummary|null
21: */
22: public ?DisputeSummary $disputeSummary = null;
23:
24: /**
25: * @return object
26: */
27: public function toObject(): object
28: {
29: $object = parent::toObject();
30: if (!is_null($this->disputeId)) {
31: $object->disputeId = $this->disputeId;
32: }
33: if (!is_null($this->disputeSummary)) {
34: $object->disputeSummary = $this->disputeSummary->toObject();
35: }
36: return $object;
37: }
38:
39: /**
40: * @param object $object
41: *
42: * @return $this
43: * @throws UnexpectedValueException
44: */
45: public function fromObject(object $object): DisputeEntryWithDisputeSummary
46: {
47: parent::fromObject($object);
48: if (property_exists($object, 'disputeId')) {
49: $this->disputeId = $object->disputeId;
50: }
51: if (property_exists($object, 'disputeSummary')) {
52: if (!is_object($object->disputeSummary)) {
53: throw new UnexpectedValueException('value \'' . print_r($object->disputeSummary, true) . '\' is not an object');
54: }
55: $value = new DisputeSummary();
56: $this->disputeSummary = $value->fromObject($object->disputeSummary);
57: }
58: return $this;
59: }
60: }
61: