commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
StoreDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
22 use stdClass;
23 
27 final 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 
84  public function getKey()
85  {
86  return $this->key;
87  }
88 
95  public function getName()
96  {
97  return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
98  }
99 
106  public function getLanguages()
107  {
108  return $this->languages;
109  }
110 
117  public function getCountries()
118  {
119  return $this->countries;
120  }
121 
128  public function getDistributionChannels()
129  {
130  return $this->distributionChannels;
131  }
132 
139  public function getSupplyChannels()
140  {
141  return $this->supplyChannels;
142  }
143 
156  public function getProductSelections()
157  {
158  return $this->productSelections;
159  }
160 
167  public function getCustom()
168  {
169  return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
170  }
171 
176  public function withKey(?string $key)
177  {
178  $this->key = $key;
179 
180  return $this;
181  }
182 
187  public function withName(?LocalizedString $name)
188  {
189  $this->name = $name;
190 
191  return $this;
192  }
193 
198  public function withLanguages(?array $languages)
199  {
200  $this->languages = $languages;
201 
202  return $this;
203  }
204 
209  public function withCountries(?StoreCountryCollection $countries)
210  {
211  $this->countries = $countries;
212 
213  return $this;
214  }
215 
220  public function withDistributionChannels(?ChannelResourceIdentifierCollection $distributionChannels)
221  {
222  $this->distributionChannels = $distributionChannels;
223 
224  return $this;
225  }
226 
231  public function withSupplyChannels(?ChannelResourceIdentifierCollection $supplyChannels)
232  {
233  $this->supplyChannels = $supplyChannels;
234 
235  return $this;
236  }
237 
243  {
244  $this->productSelections = $productSelections;
245 
246  return $this;
247  }
248 
253  public function withCustom(?CustomFieldsDraft $custom)
254  {
255  $this->custom = $custom;
256 
257  return $this;
258  }
259 
264  public function withNameBuilder(?LocalizedStringBuilder $name)
265  {
266  $this->name = $name;
267 
268  return $this;
269  }
270 
275  public function withCustomBuilder(?CustomFieldsDraftBuilder $custom)
276  {
277  $this->custom = $custom;
278 
279  return $this;
280  }
281 
282  public function build(): StoreDraft
283  {
284  return new StoreDraftModel(
285  $this->key,
286  $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
287  $this->languages,
288  $this->countries,
289  $this->distributionChannels,
290  $this->supplyChannels,
291  $this->productSelections,
292  $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
293  );
294  }
295 
296  public static function of(): StoreDraftBuilder
297  {
298  return new self();
299  }
300 }
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
withSupplyChannels(?ChannelResourceIdentifierCollection $supplyChannels)
withProductSelections(?ProductSelectionSettingDraftCollection $productSelections)
withDistributionChannels(?ChannelResourceIdentifierCollection $distributionChannels)
withCountries(?StoreCountryCollection $countries)