1: <?php
2: /*
3: * This file was automatically generated.
4: */
5: namespace Worldline\Acquiring\Sdk\V1\Domain;
6:
7: use DateTime;
8: use UnexpectedValueException;
9: use Worldline\Acquiring\Sdk\Domain\DataObject;
10:
11: /**
12: * @package Worldline\Acquiring\Sdk\V1\Domain
13: */
14: class ApiRefundReversalRequest extends DataObject
15: {
16: /**
17: * @var string
18: */
19: public $operationId = null;
20:
21: /**
22: * @var TerminalData
23: */
24: public $terminalData = null;
25:
26: /**
27: * @var DateTime
28: */
29: public $transactionTimestamp = null;
30:
31: /**
32: * @return object
33: */
34: public function toObject()
35: {
36: $object = parent::toObject();
37: if (!is_null($this->operationId)) {
38: $object->operationId = $this->operationId;
39: }
40: if (!is_null($this->terminalData)) {
41: $object->terminalData = $this->terminalData->toObject();
42: }
43: if (!is_null($this->transactionTimestamp)) {
44: $object->transactionTimestamp = $this->transactionTimestamp->format('Y-m-d\\TH:i:s.vP');
45: }
46: return $object;
47: }
48:
49: /**
50: * @param object $object
51: * @return $this
52: * @throws UnexpectedValueException
53: */
54: public function fromObject($object)
55: {
56: parent::fromObject($object);
57: if (property_exists($object, 'operationId')) {
58: $this->operationId = $object->operationId;
59: }
60: if (property_exists($object, 'terminalData')) {
61: if (!is_object($object->terminalData)) {
62: throw new UnexpectedValueException('value \'' . print_r($object->terminalData, true) . '\' is not an object');
63: }
64: $value = new TerminalData();
65: $this->terminalData = $value->fromObject($object->terminalData);
66: }
67: if (property_exists($object, 'transactionTimestamp')) {
68: $this->transactionTimestamp = new DateTime($object->transactionTimestamp);
69: }
70: return $this;
71: }
72: }
73: