1: <?php
2: /*
3: * This file was automatically generated.
4: */
5: namespace Worldline\Acquiring\Sdk\V1\Domain;
6:
7: use UnexpectedValueException;
8: use Worldline\Acquiring\Sdk\Domain\DataObject;
9:
10: /**
11: * @package Worldline\Acquiring\Sdk\V1\Domain
12: */
13: class DccData extends DataObject
14: {
15: /**
16: * @var int
17: */
18: public $amount = null;
19:
20: /**
21: * @var float
22: */
23: public $conversionRate = null;
24:
25: /**
26: * @var string
27: */
28: public $currencyCode = null;
29:
30: /**
31: * @var int
32: */
33: public $numberOfDecimals = null;
34:
35: /**
36: * @return object
37: */
38: public function toObject()
39: {
40: $object = parent::toObject();
41: if (!is_null($this->amount)) {
42: $object->amount = $this->amount;
43: }
44: if (!is_null($this->conversionRate)) {
45: $object->conversionRate = $this->conversionRate;
46: }
47: if (!is_null($this->currencyCode)) {
48: $object->currencyCode = $this->currencyCode;
49: }
50: if (!is_null($this->numberOfDecimals)) {
51: $object->numberOfDecimals = $this->numberOfDecimals;
52: }
53: return $object;
54: }
55:
56: /**
57: * @param object $object
58: * @return $this
59: * @throws UnexpectedValueException
60: */
61: public function fromObject($object)
62: {
63: parent::fromObject($object);
64: if (property_exists($object, 'amount')) {
65: $this->amount = $object->amount;
66: }
67: if (property_exists($object, 'conversionRate')) {
68: $this->conversionRate = $object->conversionRate;
69: }
70: if (property_exists($object, 'currencyCode')) {
71: $this->currencyCode = $object->currencyCode;
72: }
73: if (property_exists($object, 'numberOfDecimals')) {
74: $this->numberOfDecimals = $object->numberOfDecimals;
75: }
76: return $this;
77: }
78: }
79: