commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
LineItemStateTransitionMessageBuilder.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 $lineItemId;
97 
102  private $lineItemKey;
103 
108  private $transitionDate;
109 
114  private $quantity;
115 
120  private $fromState;
121 
126  private $toState;
127 
134  public function getId()
135  {
136  return $this->id;
137  }
138 
145  public function getVersion()
146  {
147  return $this->version;
148  }
149 
156  public function getCreatedAt()
157  {
158  return $this->createdAt;
159  }
160 
167  public function getLastModifiedAt()
168  {
169  return $this->lastModifiedAt;
170  }
171 
178  public function getLastModifiedBy()
179  {
180  return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
181  }
182 
189  public function getCreatedBy()
190  {
191  return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
192  }
193 
201  public function getSequenceNumber()
202  {
203  return $this->sequenceNumber;
204  }
205 
212  public function getResource()
213  {
214  return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource;
215  }
216 
223  public function getResourceVersion()
224  {
225  return $this->resourceVersion;
226  }
227 
235  {
236  return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers;
237  }
238 
245  public function getLineItemId()
246  {
247  return $this->lineItemId;
248  }
249 
256  public function getLineItemKey()
257  {
258  return $this->lineItemKey;
259  }
260 
267  public function getTransitionDate()
268  {
269  return $this->transitionDate;
270  }
271 
278  public function getQuantity()
279  {
280  return $this->quantity;
281  }
282 
289  public function getFromState()
290  {
291  return $this->fromState instanceof StateReferenceBuilder ? $this->fromState->build() : $this->fromState;
292  }
293 
300  public function getToState()
301  {
302  return $this->toState instanceof StateReferenceBuilder ? $this->toState->build() : $this->toState;
303  }
304 
309  public function withId(?string $id)
310  {
311  $this->id = $id;
312 
313  return $this;
314  }
315 
320  public function withVersion(?int $version)
321  {
322  $this->version = $version;
323 
324  return $this;
325  }
326 
331  public function withCreatedAt(?DateTimeImmutable $createdAt)
332  {
333  $this->createdAt = $createdAt;
334 
335  return $this;
336  }
337 
342  public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
343  {
344  $this->lastModifiedAt = $lastModifiedAt;
345 
346  return $this;
347  }
348 
353  public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
354  {
355  $this->lastModifiedBy = $lastModifiedBy;
356 
357  return $this;
358  }
359 
364  public function withCreatedBy(?CreatedBy $createdBy)
365  {
366  $this->createdBy = $createdBy;
367 
368  return $this;
369  }
370 
375  public function withSequenceNumber(?int $sequenceNumber)
376  {
377  $this->sequenceNumber = $sequenceNumber;
378 
379  return $this;
380  }
381 
386  public function withResource(?Reference $resource)
387  {
388  $this->resource = $resource;
389 
390  return $this;
391  }
392 
397  public function withResourceVersion(?int $resourceVersion)
398  {
399  $this->resourceVersion = $resourceVersion;
400 
401  return $this;
402  }
403 
408  public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)
409  {
410  $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
411 
412  return $this;
413  }
414 
419  public function withLineItemId(?string $lineItemId)
420  {
421  $this->lineItemId = $lineItemId;
422 
423  return $this;
424  }
425 
430  public function withLineItemKey(?string $lineItemKey)
431  {
432  $this->lineItemKey = $lineItemKey;
433 
434  return $this;
435  }
436 
441  public function withTransitionDate(?DateTimeImmutable $transitionDate)
442  {
443  $this->transitionDate = $transitionDate;
444 
445  return $this;
446  }
447 
452  public function withQuantity(?int $quantity)
453  {
454  $this->quantity = $quantity;
455 
456  return $this;
457  }
458 
463  public function withFromState(?StateReference $fromState)
464  {
465  $this->fromState = $fromState;
466 
467  return $this;
468  }
469 
474  public function withToState(?StateReference $toState)
475  {
476  $this->toState = $toState;
477 
478  return $this;
479  }
480 
485  public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
486  {
487  $this->lastModifiedBy = $lastModifiedBy;
488 
489  return $this;
490  }
491 
496  public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
497  {
498  $this->createdBy = $createdBy;
499 
500  return $this;
501  }
502 
507  public function withResourceBuilder(?ReferenceBuilder $resource)
508  {
509  $this->resource = $resource;
510 
511  return $this;
512  }
513 
518  public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)
519  {
520  $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
521 
522  return $this;
523  }
524 
529  public function withFromStateBuilder(?StateReferenceBuilder $fromState)
530  {
531  $this->fromState = $fromState;
532 
533  return $this;
534  }
535 
540  public function withToStateBuilder(?StateReferenceBuilder $toState)
541  {
542  $this->toState = $toState;
543 
544  return $this;
545  }
546 
548  {
550  $this->id,
551  $this->version,
552  $this->createdAt,
553  $this->lastModifiedAt,
554  $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
555  $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
556  $this->sequenceNumber,
557  $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource,
558  $this->resourceVersion,
559  $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers,
560  $this->lineItemId,
561  $this->lineItemKey,
562  $this->transitionDate,
563  $this->quantity,
564  $this->fromState instanceof StateReferenceBuilder ? $this->fromState->build() : $this->fromState,
565  $this->toState instanceof StateReferenceBuilder ? $this->toState->build() : $this->toState
566  );
567  }
568 
569  public static function of(): LineItemStateTransitionMessageBuilder
570  {
571  return new self();
572  }
573 }
withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)
withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)