commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
UnknownChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
20final class UnknownChangeModel extends JsonObjectModel implements UnknownChange
21{
22
23 public const DISCRIMINATOR_VALUE = 'UnknownChange';
28 protected $type;
29
34 protected $change;
35
40 protected $previousValue;
41
46 protected $nextValue;
47
48
52 public function __construct(
53 ?string $change = null,
54 $previousValue = null,
55 $nextValue = null,
56 ?string $type = null
57 ) {
58 $this->change = $change;
59 $this->previousValue = $previousValue;
60 $this->nextValue = $nextValue;
61 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
62 }
63
68 public function getType()
69 {
70 if (is_null($this->type)) {
72 $data = $this->raw(self::FIELD_TYPE);
73 if (is_null($data)) {
74 return null;
75 }
76 $this->type = (string) $data;
77 }
78
79 return $this->type;
80 }
81
88 public function getChange()
89 {
90 if (is_null($this->change)) {
92 $data = $this->raw(self::FIELD_CHANGE);
93 if (is_null($data)) {
94 return null;
95 }
96 $this->change = (string) $data;
97 }
98
99 return $this->change;
100 }
101
108 public function getPreviousValue()
109 {
110 if (is_null($this->previousValue)) {
112 $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
113 if (is_null($data)) {
114 return null;
115 }
116 $this->previousValue = $data;
117 }
118
120 }
121
128 public function getNextValue()
129 {
130 if (is_null($this->nextValue)) {
132 $data = $this->raw(self::FIELD_NEXT_VALUE);
133 if (is_null($data)) {
134 return null;
135 }
136 $this->nextValue = $data;
137 }
138
139 return $this->nextValue;
140 }
141
142
146 public function setChange(?string $change): void
147 {
148 $this->change = $change;
149 }
150
154 public function setPreviousValue( $previousValue): void
155 {
156 $this->previousValue = $previousValue;
157 }
158
162 public function setNextValue( $nextValue): void
163 {
164 $this->nextValue = $nextValue;
165 }
166
167
168
169}
__construct(?string $change=null, $previousValue=null, $nextValue=null, ?string $type=null)