commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
SetAssetKeyChangeBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
19
23final class SetAssetKeyChangeBuilder implements Builder
24{
29 private $change;
30
35 private $previousValue;
36
41 private $nextValue;
42
47 private $asset;
48
53 private $catalogData;
54
59 private $variant;
60
65 public function getChange()
66 {
67 return $this->change;
68 }
69
76 public function getPreviousValue()
77 {
78 return $this->previousValue;
79 }
80
87 public function getNextValue()
88 {
89 return $this->nextValue;
90 }
91
98 public function getAsset()
99 {
100 return $this->asset instanceof AssetChangeValueBuilder ? $this->asset->build() : $this->asset;
101 }
102
113 public function getCatalogData()
114 {
115 return $this->catalogData;
116 }
117
125 public function getVariant()
126 {
127 return $this->variant;
128 }
129
134 public function withChange(?string $change)
135 {
136 $this->change = $change;
137
138 return $this;
139 }
140
145 public function withPreviousValue(?string $previousValue)
146 {
147 $this->previousValue = $previousValue;
148
149 return $this;
150 }
151
156 public function withNextValue(?string $nextValue)
157 {
158 $this->nextValue = $nextValue;
159
160 return $this;
161 }
162
167 public function withAsset(?AssetChangeValue $asset)
168 {
169 $this->asset = $asset;
170
171 return $this;
172 }
173
178 public function withCatalogData(?string $catalogData)
179 {
180 $this->catalogData = $catalogData;
181
182 return $this;
183 }
184
189 public function withVariant(?string $variant)
190 {
191 $this->variant = $variant;
192
193 return $this;
194 }
195
201 {
202 $this->asset = $asset;
203
204 return $this;
205 }
206
207 public function build(): SetAssetKeyChange
208 {
209 return new SetAssetKeyChangeModel(
210 $this->change,
211 $this->previousValue,
212 $this->nextValue,
213 $this->asset instanceof AssetChangeValueBuilder ? $this->asset->build() : $this->asset,
214 $this->catalogData,
215 $this->variant
216 );
217 }
218
219 public static function of(): SetAssetKeyChangeBuilder
220 {
221 return new self();
222 }
223}