commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SetParcelItemsChangeBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
20
25{
30 private $change;
31
36 private $previousValue;
37
42 private $nextValue;
43
48 private $parcel;
49
54 public function getChange()
55 {
56 return $this->change;
57 }
58
65 public function getPreviousValue()
66 {
67 return $this->previousValue;
68 }
69
76 public function getNextValue()
77 {
78 return $this->nextValue;
79 }
80
87 public function getParcel()
88 {
89 return $this->parcel instanceof ParcelChangeValueBuilder ? $this->parcel->build() : $this->parcel;
90 }
91
96 public function withChange(?string $change)
97 {
98 $this->change = $change;
99
100 return $this;
101 }
102
107 public function withPreviousValue(?DeliveryItemCollection $previousValue)
108 {
109 $this->previousValue = $previousValue;
110
111 return $this;
112 }
113
118 public function withNextValue(?DeliveryItemCollection $nextValue)
119 {
120 $this->nextValue = $nextValue;
121
122 return $this;
123 }
124
129 public function withParcel(?ParcelChangeValue $parcel)
130 {
131 $this->parcel = $parcel;
132
133 return $this;
134 }
135
141 {
142 $this->parcel = $parcel;
143
144 return $this;
145 }
146
147 public function build(): SetParcelItemsChange
148 {
149 return new SetParcelItemsChangeModel(
150 $this->change,
151 $this->previousValue,
152 $this->nextValue,
153 $this->parcel instanceof ParcelChangeValueBuilder ? $this->parcel->build() : $this->parcel
154 );
155 }
156
157 public static function of(): SetParcelItemsChangeBuilder
158 {
159 return new self();
160 }
161}