1: | <?php |
2: | |
3: | |
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: | |
13: | |
14: | class ApiTechnicalReversalRequest extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $operationId = null; |
20: | |
21: | |
22: | |
23: | |
24: | public $reason = null; |
25: | |
26: | |
27: | |
28: | |
29: | public $transactionTimestamp = null; |
30: | |
31: | |
32: | |
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->reason)) { |
41: | $object->reason = $this->reason; |
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: | |
51: | |
52: | |
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, 'reason')) { |
61: | $this->reason = $object->reason; |
62: | } |
63: | if (property_exists($object, 'transactionTimestamp')) { |
64: | $this->transactionTimestamp = new DateTime($object->transactionTimestamp); |
65: | } |
66: | return $this; |
67: | } |
68: | } |
69: | |