commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ChangeLineItemQuantityChangeModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
18 
23 {
24 
25  public const DISCRIMINATOR_VALUE = 'ChangeLineItemQuantityChange';
30  protected $type;
31 
36  protected $change;
37 
42  protected $previousValue;
43 
48  protected $nextValue;
49 
54  protected $lineItem;
55 
60  protected $lineItemId;
61 
62 
66  public function __construct(
67  ?string $change = null,
68  ?int $previousValue = null,
69  ?int $nextValue = null,
70  ?LocalizedString $lineItem = null,
71  ?string $lineItemId = null,
72  ?string $type = null
73  ) {
74  $this->change = $change;
75  $this->previousValue = $previousValue;
76  $this->nextValue = $nextValue;
77  $this->lineItem = $lineItem;
78  $this->lineItemId = $lineItemId;
79  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
80  }
81 
86  public function getType()
87  {
88  if (is_null($this->type)) {
90  $data = $this->raw(self::FIELD_TYPE);
91  if (is_null($data)) {
92  return null;
93  }
94  $this->type = (string) $data;
95  }
96 
97  return $this->type;
98  }
99 
104  public function getChange()
105  {
106  if (is_null($this->change)) {
108  $data = $this->raw(self::FIELD_CHANGE);
109  if (is_null($data)) {
110  return null;
111  }
112  $this->change = (string) $data;
113  }
114 
115  return $this->change;
116  }
117 
124  public function getPreviousValue()
125  {
126  if (is_null($this->previousValue)) {
128  $data = $this->raw(self::FIELD_PREVIOUS_VALUE);
129  if (is_null($data)) {
130  return null;
131  }
132  $this->previousValue = (int) $data;
133  }
134 
135  return $this->previousValue;
136  }
137 
144  public function getNextValue()
145  {
146  if (is_null($this->nextValue)) {
148  $data = $this->raw(self::FIELD_NEXT_VALUE);
149  if (is_null($data)) {
150  return null;
151  }
152  $this->nextValue = (int) $data;
153  }
154 
155  return $this->nextValue;
156  }
157 
164  public function getLineItem()
165  {
166  if (is_null($this->lineItem)) {
168  $data = $this->raw(self::FIELD_LINE_ITEM);
169  if (is_null($data)) {
170  return null;
171  }
172 
173  $this->lineItem = LocalizedStringModel::of($data);
174  }
175 
176  return $this->lineItem;
177  }
178 
185  public function getLineItemId()
186  {
187  if (is_null($this->lineItemId)) {
189  $data = $this->raw(self::FIELD_LINE_ITEM_ID);
190  if (is_null($data)) {
191  return null;
192  }
193  $this->lineItemId = (string) $data;
194  }
195 
196  return $this->lineItemId;
197  }
198 
199 
203  public function setChange(?string $change): void
204  {
205  $this->change = $change;
206  }
207 
211  public function setPreviousValue(?int $previousValue): void
212  {
213  $this->previousValue = $previousValue;
214  }
215 
219  public function setNextValue(?int $nextValue): void
220  {
221  $this->nextValue = $nextValue;
222  }
223 
227  public function setLineItem(?LocalizedString $lineItem): void
228  {
229  $this->lineItem = $lineItem;
230  }
231 
235  public function setLineItemId(?string $lineItemId): void
236  {
237  $this->lineItemId = $lineItemId;
238  }
239 
240 
241 
242 }
static of($data=null)
Definition: MapperMap.php:45
__construct(?string $change=null, ?int $previousValue=null, ?int $nextValue=null, ?LocalizedString $lineItem=null, ?string $lineItemId=null, ?string $type=null)