commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
StoreDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
22use stdClass;
23
27final class StoreDraftBuilder implements Builder
28{
33 private $key;
34
39 private $name;
40
45 private $languages;
46
51 private $countries;
52
57 private $distributionChannels;
58
63 private $supplyChannels;
64
69 private $productSelections;
70
75 private $custom;
76
81 private $storefront;
82
90 public function getKey()
91 {
92 return $this->key;
93 }
94
101 public function getName()
102 {
103 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
104 }
105
113 public function getLanguages()
114 {
115 return $this->languages;
116 }
117
124 public function getCountries()
125 {
126 return $this->countries;
127 }
128
136 public function getDistributionChannels()
137 {
138 return $this->distributionChannels;
139 }
140
148 public function getSupplyChannels()
149 {
150 return $this->supplyChannels;
151 }
152
165 public function getProductSelections()
166 {
167 return $this->productSelections;
168 }
169
176 public function getCustom()
177 {
178 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
179 }
180
187 public function getStorefront()
188 {
189 return $this->storefront instanceof StorefrontBuilder ? $this->storefront->build() : $this->storefront;
190 }
191
196 public function withKey(?string $key)
197 {
198 $this->key = $key;
199
200 return $this;
201 }
202
207 public function withName(?LocalizedString $name)
208 {
209 $this->name = $name;
210
211 return $this;
212 }
213
218 public function withLanguages(?array $languages)
219 {
220 $this->languages = $languages;
221
222 return $this;
223 }
224
229 public function withCountries(?StoreCountryCollection $countries)
230 {
231 $this->countries = $countries;
232
233 return $this;
234 }
235
240 public function withDistributionChannels(?ChannelResourceIdentifierCollection $distributionChannels)
241 {
242 $this->distributionChannels = $distributionChannels;
243
244 return $this;
245 }
246
252 {
253 $this->supplyChannels = $supplyChannels;
254
255 return $this;
256 }
257
263 {
264 $this->productSelections = $productSelections;
265
266 return $this;
267 }
268
273 public function withCustom(?CustomFieldsDraft $custom)
274 {
275 $this->custom = $custom;
276
277 return $this;
278 }
279
284 public function withStorefront(?Storefront $storefront)
285 {
286 $this->storefront = $storefront;
287
288 return $this;
289 }
290
296 {
297 $this->name = $name;
298
299 return $this;
300 }
301
307 {
308 $this->custom = $custom;
309
310 return $this;
311 }
312
317 public function withStorefrontBuilder(?StorefrontBuilder $storefront)
318 {
319 $this->storefront = $storefront;
320
321 return $this;
322 }
323
324 public function build(): StoreDraft
325 {
326 return new StoreDraftModel(
327 $this->key,
328 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
329 $this->languages,
330 $this->countries,
331 $this->distributionChannels,
332 $this->supplyChannels,
333 $this->productSelections,
334 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom,
335 $this->storefront instanceof StorefrontBuilder ? $this->storefront->build() : $this->storefront
336 );
337 }
338
339 public static function of(): StoreDraftBuilder
340 {
341 return new self();
342 }
343}
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
withSupplyChannels(?ChannelResourceIdentifierCollection $supplyChannels)
withProductSelections(?ProductSelectionSettingDraftCollection $productSelections)
withStorefrontBuilder(?StorefrontBuilder $storefront)
withDistributionChannels(?ChannelResourceIdentifierCollection $distributionChannels)
withCountries(?StoreCountryCollection $countries)