commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ChangeLineItemPublishedChangeModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
18
23{
24
25 public const DISCRIMINATOR_VALUE = 'ChangeLineItemPublishedChange';
30 protected $type;
31
36 protected $change;
37
42 protected $lineItem;
43
48 protected $previousValue;
49
54 protected $nextValue;
55
56
60 public function __construct(
61 ?string $change = null,
63 ?bool $previousValue = null,
64 ?bool $nextValue = null,
65 ?string $type = null
66 ) {
67 $this->change = $change;
68 $this->lineItem = $lineItem;
69 $this->previousValue = $previousValue;
70 $this->nextValue = $nextValue;
71 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
72 }
73
78 public function getType()
79 {
80 if (is_null($this->type)) {
82 $data = $this->raw(self::FIELD_TYPE);
83 if (is_null($data)) {
84 return null;
85 }
86 $this->type = (string) $data;
87 }
88
89 return $this->type;
90 }
91
96 public function getChange()
97 {
98 if (is_null($this->change)) {
100 $data = $this->raw(self::FIELD_CHANGE);
101 if (is_null($data)) {
102 return null;
103 }
104 $this->change = (string) $data;
105 }
106
107 return $this->change;
108 }
109
116 public function getLineItem()
117 {
118 if (is_null($this->lineItem)) {
120 $data = $this->raw(self::FIELD_LINE_ITEM);
121 if (is_null($data)) {
122 return null;
123 }
124
125 $this->lineItem = ShoppingListLineItemValueModel::of($data);
126 }
127
128 return $this->lineItem;
129 }
130
137 public function getPreviousValue()
138 {
139 if (is_null($this->previousValue)) {
141 $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
142 if (is_null($data)) {
143 return null;
144 }
145 $this->previousValue = (bool) $data;
146 }
147
149 }
150
157 public function getNextValue()
158 {
159 if (is_null($this->nextValue)) {
161 $data = $this->raw(self::FIELD_NEXT_VALUE);
162 if (is_null($data)) {
163 return null;
164 }
165 $this->nextValue = (bool) $data;
166 }
167
168 return $this->nextValue;
169 }
170
171
175 public function setChange(?string $change): void
176 {
177 $this->change = $change;
178 }
179
184 {
185 $this->lineItem = $lineItem;
186 }
187
191 public function setPreviousValue(?bool $previousValue): void
192 {
193 $this->previousValue = $previousValue;
194 }
195
199 public function setNextValue(?bool $nextValue): void
200 {
201 $this->nextValue = $nextValue;
202 }
203
204
205
206}
__construct(?string $change=null, ?ShoppingListLineItemValue $lineItem=null, ?bool $previousValue=null, ?bool $nextValue=null, ?string $type=null)