commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
DeliveryChangeValueBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
21 
25 final class DeliveryChangeValueBuilder implements Builder
26 {
31  private $items;
32 
37  private $address;
38 
43  private $parcels;
44 
51  public function getItems()
52  {
53  return $this->items;
54  }
55 
62  public function getAddress()
63  {
64  return $this->address instanceof AddressBuilder ? $this->address->build() : $this->address;
65  }
66 
73  public function getParcels()
74  {
75  return $this->parcels;
76  }
77 
82  public function withItems(?DeliveryItemCollection $items)
83  {
84  $this->items = $items;
85 
86  return $this;
87  }
88 
93  public function withAddress(?Address $address)
94  {
95  $this->address = $address;
96 
97  return $this;
98  }
99 
104  public function withParcels(?ParcelCollection $parcels)
105  {
106  $this->parcels = $parcels;
107 
108  return $this;
109  }
110 
115  public function withAddressBuilder(?AddressBuilder $address)
116  {
117  $this->address = $address;
118 
119  return $this;
120  }
121 
122  public function build(): DeliveryChangeValue
123  {
124  return new DeliveryChangeValueModel(
125  $this->items,
126  $this->address instanceof AddressBuilder ? $this->address->build() : $this->address,
127  $this->parcels
128  );
129  }
130 
131  public static function of(): DeliveryChangeValueBuilder
132  {
133  return new self();
134  }
135 }