commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
OrderStateTransitionMessageBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
24 use DateTimeImmutable;
25 use stdClass;
26 
31 {
36  private $id;
37 
42  private $version;
43 
48  private $createdAt;
49 
54  private $lastModifiedAt;
55 
60  private $lastModifiedBy;
61 
66  private $createdBy;
67 
72  private $sequenceNumber;
73 
78  private $resource;
79 
84  private $resourceVersion;
85 
90  private $resourceUserProvidedIdentifiers;
91 
96  private $state;
97 
102  private $oldState;
103 
108  private $force;
109 
116  public function getId()
117  {
118  return $this->id;
119  }
120 
127  public function getVersion()
128  {
129  return $this->version;
130  }
131 
138  public function getCreatedAt()
139  {
140  return $this->createdAt;
141  }
142 
149  public function getLastModifiedAt()
150  {
151  return $this->lastModifiedAt;
152  }
153 
160  public function getLastModifiedBy()
161  {
162  return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
163  }
164 
171  public function getCreatedBy()
172  {
173  return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
174  }
175 
183  public function getSequenceNumber()
184  {
185  return $this->sequenceNumber;
186  }
187 
194  public function getResource()
195  {
196  return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource;
197  }
198 
205  public function getResourceVersion()
206  {
207  return $this->resourceVersion;
208  }
209 
217  {
218  return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers;
219  }
220 
227  public function getState()
228  {
229  return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
230  }
231 
238  public function getOldState()
239  {
240  return $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState;
241  }
242 
249  public function getForce()
250  {
251  return $this->force;
252  }
253 
258  public function withId(?string $id)
259  {
260  $this->id = $id;
261 
262  return $this;
263  }
264 
269  public function withVersion(?int $version)
270  {
271  $this->version = $version;
272 
273  return $this;
274  }
275 
280  public function withCreatedAt(?DateTimeImmutable $createdAt)
281  {
282  $this->createdAt = $createdAt;
283 
284  return $this;
285  }
286 
291  public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
292  {
293  $this->lastModifiedAt = $lastModifiedAt;
294 
295  return $this;
296  }
297 
302  public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
303  {
304  $this->lastModifiedBy = $lastModifiedBy;
305 
306  return $this;
307  }
308 
313  public function withCreatedBy(?CreatedBy $createdBy)
314  {
315  $this->createdBy = $createdBy;
316 
317  return $this;
318  }
319 
324  public function withSequenceNumber(?int $sequenceNumber)
325  {
326  $this->sequenceNumber = $sequenceNumber;
327 
328  return $this;
329  }
330 
335  public function withResource(?Reference $resource)
336  {
337  $this->resource = $resource;
338 
339  return $this;
340  }
341 
346  public function withResourceVersion(?int $resourceVersion)
347  {
348  $this->resourceVersion = $resourceVersion;
349 
350  return $this;
351  }
352 
357  public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)
358  {
359  $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
360 
361  return $this;
362  }
363 
368  public function withState(?StateReference $state)
369  {
370  $this->state = $state;
371 
372  return $this;
373  }
374 
379  public function withOldState(?StateReference $oldState)
380  {
381  $this->oldState = $oldState;
382 
383  return $this;
384  }
385 
390  public function withForce(?bool $force)
391  {
392  $this->force = $force;
393 
394  return $this;
395  }
396 
401  public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
402  {
403  $this->lastModifiedBy = $lastModifiedBy;
404 
405  return $this;
406  }
407 
412  public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
413  {
414  $this->createdBy = $createdBy;
415 
416  return $this;
417  }
418 
423  public function withResourceBuilder(?ReferenceBuilder $resource)
424  {
425  $this->resource = $resource;
426 
427  return $this;
428  }
429 
434  public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)
435  {
436  $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
437 
438  return $this;
439  }
440 
445  public function withStateBuilder(?StateReferenceBuilder $state)
446  {
447  $this->state = $state;
448 
449  return $this;
450  }
451 
456  public function withOldStateBuilder(?StateReferenceBuilder $oldState)
457  {
458  $this->oldState = $oldState;
459 
460  return $this;
461  }
462 
464  {
466  $this->id,
467  $this->version,
468  $this->createdAt,
469  $this->lastModifiedAt,
470  $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
471  $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
472  $this->sequenceNumber,
473  $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource,
474  $this->resourceVersion,
475  $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers,
476  $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state,
477  $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState,
478  $this->force
479  );
480  }
481 
482  public static function of(): OrderStateTransitionMessageBuilder
483  {
484  return new self();
485  }
486 }
withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)
withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)