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 CardEssentials extends DataObject
15: {
16: /**
17: * @var string
18: */
19: public $cardNumber = null;
20:
21: /**
22: * @var string
23: */
24: public $cardholderName = null;
25:
26: /**
27: * @var string
28: */
29: public $expiryDate = null;
30:
31: /**
32: * @return object
33: */
34: public function toObject()
35: {
36: $object = parent::toObject();
37: if (!is_null($this->cardNumber)) {
38: $object->cardNumber = $this->cardNumber;
39: }
40: if (!is_null($this->cardholderName)) {
41: $object->cardholderName = $this->cardholderName;
42: }
43: if (!is_null($this->expiryDate)) {
44: $object->expiryDate = $this->expiryDate;
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, 'cardNumber')) {
58: $this->cardNumber = $object->cardNumber;
59: }
60: if (property_exists($object, 'cardholderName')) {
61: $this->cardholderName = $object->cardholderName;
62: }
63: if (property_exists($object, 'expiryDate')) {
64: $this->expiryDate = $object->expiryDate;
65: }
66: return $this;
67: }
68: }
69: