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:
10: /**
11: * @package Worldline\Connect\Sdk\V1\Domain
12: */
13: class RedirectPaymentMethodSpecificInputBase extends AbstractRedirectPaymentMethodSpecificInput
14: {
15: /**
16: * @var RedirectPaymentProduct4101SpecificInputBase
17: */
18: public $paymentProduct4101SpecificInput = null;
19:
20: /**
21: * @var RedirectPaymentProduct838SpecificInputBase
22: */
23: public $paymentProduct838SpecificInput = null;
24:
25: /**
26: * @var RedirectPaymentProduct840SpecificInputBase
27: */
28: public $paymentProduct840SpecificInput = null;
29:
30: /**
31: * @return object
32: */
33: public function toObject()
34: {
35: $object = parent::toObject();
36: if (!is_null($this->paymentProduct4101SpecificInput)) {
37: $object->paymentProduct4101SpecificInput = $this->paymentProduct4101SpecificInput->toObject();
38: }
39: if (!is_null($this->paymentProduct838SpecificInput)) {
40: $object->paymentProduct838SpecificInput = $this->paymentProduct838SpecificInput->toObject();
41: }
42: if (!is_null($this->paymentProduct840SpecificInput)) {
43: $object->paymentProduct840SpecificInput = $this->paymentProduct840SpecificInput->toObject();
44: }
45: return $object;
46: }
47:
48: /**
49: * @param object $object
50: * @return $this
51: * @throws UnexpectedValueException
52: */
53: public function fromObject($object)
54: {
55: parent::fromObject($object);
56: if (property_exists($object, 'paymentProduct4101SpecificInput')) {
57: if (!is_object($object->paymentProduct4101SpecificInput)) {
58: throw new UnexpectedValueException('value \'' . print_r($object->paymentProduct4101SpecificInput, true) . '\' is not an object');
59: }
60: $value = new RedirectPaymentProduct4101SpecificInputBase();
61: $this->paymentProduct4101SpecificInput = $value->fromObject($object->paymentProduct4101SpecificInput);
62: }
63: if (property_exists($object, 'paymentProduct838SpecificInput')) {
64: if (!is_object($object->paymentProduct838SpecificInput)) {
65: throw new UnexpectedValueException('value \'' . print_r($object->paymentProduct838SpecificInput, true) . '\' is not an object');
66: }
67: $value = new RedirectPaymentProduct838SpecificInputBase();
68: $this->paymentProduct838SpecificInput = $value->fromObject($object->paymentProduct838SpecificInput);
69: }
70: if (property_exists($object, 'paymentProduct840SpecificInput')) {
71: if (!is_object($object->paymentProduct840SpecificInput)) {
72: throw new UnexpectedValueException('value \'' . print_r($object->paymentProduct840SpecificInput, true) . '\' is not an object');
73: }
74: $value = new RedirectPaymentProduct840SpecificInputBase();
75: $this->paymentProduct840SpecificInput = $value->fromObject($object->paymentProduct840SpecificInput);
76: }
77: return $this;
78: }
79: }
80: