commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ParcelItemsBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
22 final class ParcelItemsBuilder implements Builder
23 {
28  private $parcelId;
29 
34  private $items;
35 
40  public function getParcelId()
41  {
42  return $this->parcelId;
43  }
44 
49  public function getItems()
50  {
51  return $this->items;
52  }
53 
58  public function withParcelId(?string $parcelId)
59  {
60  $this->parcelId = $parcelId;
61 
62  return $this;
63  }
64 
69  public function withItems(?DeliveryItemCollection $items)
70  {
71  $this->items = $items;
72 
73  return $this;
74  }
75 
76 
77  public function build(): ParcelItems
78  {
79  return new ParcelItemsModel(
80  $this->parcelId,
81  $this->items
82  );
83  }
84 
85  public static function of(): ParcelItemsBuilder
86  {
87  return new self();
88  }
89 }