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 RecurringPaymentsData extends DataObject
15: {
16: /**
17: * @var PaymentProduct302SpecificInput
18: */
19: public $paymentProduct302SpecificInput = null;
20:
21: /**
22: * @var string
23: */
24: public $recurringEndDate = null;
25:
26: /**
27: * @var Frequency
28: */
29: public $recurringInterval = null;
30:
31: /**
32: * @var string
33: */
34: public $recurringStartDate = null;
35:
36: /**
37: * @var TrialInformation
38: */
39: public $trialInformation = null;
40:
41: /**
42: * @return object
43: */
44: public function toObject()
45: {
46: $object = parent::toObject();
47: if (!is_null($this->paymentProduct302SpecificInput)) {
48: $object->paymentProduct302SpecificInput = $this->paymentProduct302SpecificInput->toObject();
49: }
50: if (!is_null($this->recurringEndDate)) {
51: $object->recurringEndDate = $this->recurringEndDate;
52: }
53: if (!is_null($this->recurringInterval)) {
54: $object->recurringInterval = $this->recurringInterval->toObject();
55: }
56: if (!is_null($this->recurringStartDate)) {
57: $object->recurringStartDate = $this->recurringStartDate;
58: }
59: if (!is_null($this->trialInformation)) {
60: $object->trialInformation = $this->trialInformation->toObject();
61: }
62: return $object;
63: }
64:
65: /**
66: * @param object $object
67: * @return $this
68: * @throws UnexpectedValueException
69: */
70: public function fromObject($object)
71: {
72: parent::fromObject($object);
73: if (property_exists($object, 'paymentProduct302SpecificInput')) {
74: if (!is_object($object->paymentProduct302SpecificInput)) {
75: throw new UnexpectedValueException('value \'' . print_r($object->paymentProduct302SpecificInput, true) . '\' is not an object');
76: }
77: $value = new PaymentProduct302SpecificInput();
78: $this->paymentProduct302SpecificInput = $value->fromObject($object->paymentProduct302SpecificInput);
79: }
80: if (property_exists($object, 'recurringEndDate')) {
81: $this->recurringEndDate = $object->recurringEndDate;
82: }
83: if (property_exists($object, 'recurringInterval')) {
84: if (!is_object($object->recurringInterval)) {
85: throw new UnexpectedValueException('value \'' . print_r($object->recurringInterval, true) . '\' is not an object');
86: }
87: $value = new Frequency();
88: $this->recurringInterval = $value->fromObject($object->recurringInterval);
89: }
90: if (property_exists($object, 'recurringStartDate')) {
91: $this->recurringStartDate = $object->recurringStartDate;
92: }
93: if (property_exists($object, 'trialInformation')) {
94: if (!is_object($object->trialInformation)) {
95: throw new UnexpectedValueException('value \'' . print_r($object->trialInformation, true) . '\' is not an object');
96: }
97: $value = new TrialInformation();
98: $this->trialInformation = $value->fromObject($object->trialInformation);
99: }
100: return $this;
101: }
102: }
103: