commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
StoreDraftModel.php
1<?php
2
3declare(strict_types=1);
10
21use stdClass;
22
26final class StoreDraftModel extends JsonObjectModel implements StoreDraft
27{
32 protected $key;
33
38 protected $name;
39
44 protected $languages;
45
50 protected $countries;
51
57
62 protected $supplyChannels;
63
69
74 protected $custom;
75
80 protected $storefront;
81
82
86 public function __construct(
87 ?string $key = null,
88 ?LocalizedString $name = null,
89 ?array $languages = null,
96 ) {
97 $this->key = $key;
98 $this->name = $name;
99 $this->languages = $languages;
100 $this->countries = $countries;
101 $this->distributionChannels = $distributionChannels;
102 $this->supplyChannels = $supplyChannels;
103 $this->productSelections = $productSelections;
104 $this->custom = $custom;
105 $this->storefront = $storefront;
106 }
107
115 public function getKey()
116 {
117 if (is_null($this->key)) {
119 $data = $this->raw(self::FIELD_KEY);
120 if (is_null($data)) {
121 return null;
122 }
123 $this->key = (string) $data;
124 }
125
126 return $this->key;
127 }
128
135 public function getName()
136 {
137 if (is_null($this->name)) {
139 $data = $this->raw(self::FIELD_NAME);
140 if (is_null($data)) {
141 return null;
142 }
143
144 $this->name = LocalizedStringModel::of($data);
145 }
146
147 return $this->name;
148 }
149
157 public function getLanguages()
158 {
159 if (is_null($this->languages)) {
161 $data = $this->raw(self::FIELD_LANGUAGES);
162 if (is_null($data)) {
163 return null;
164 }
165 $this->languages = $data;
166 }
167
168 return $this->languages;
169 }
170
177 public function getCountries()
178 {
179 if (is_null($this->countries)) {
181 $data = $this->raw(self::FIELD_COUNTRIES);
182 if (is_null($data)) {
183 return null;
184 }
185 $this->countries = StoreCountryCollection::fromArray($data);
186 }
187
188 return $this->countries;
189 }
190
198 public function getDistributionChannels()
199 {
200 if (is_null($this->distributionChannels)) {
202 $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNELS);
203 if (is_null($data)) {
204 return null;
205 }
206 $this->distributionChannels = ChannelResourceIdentifierCollection::fromArray($data);
207 }
208
210 }
211
219 public function getSupplyChannels()
220 {
221 if (is_null($this->supplyChannels)) {
223 $data = $this->raw(self::FIELD_SUPPLY_CHANNELS);
224 if (is_null($data)) {
225 return null;
226 }
227 $this->supplyChannels = ChannelResourceIdentifierCollection::fromArray($data);
228 }
229
231 }
232
245 public function getProductSelections()
246 {
247 if (is_null($this->productSelections)) {
249 $data = $this->raw(self::FIELD_PRODUCT_SELECTIONS);
250 if (is_null($data)) {
251 return null;
252 }
253 $this->productSelections = ProductSelectionSettingDraftCollection::fromArray($data);
254 }
255
257 }
258
265 public function getCustom()
266 {
267 if (is_null($this->custom)) {
269 $data = $this->raw(self::FIELD_CUSTOM);
270 if (is_null($data)) {
271 return null;
272 }
273
274 $this->custom = CustomFieldsDraftModel::of($data);
275 }
276
277 return $this->custom;
278 }
279
286 public function getStorefront()
287 {
288 if (is_null($this->storefront)) {
290 $data = $this->raw(self::FIELD_STOREFRONT);
291 if (is_null($data)) {
292 return null;
293 }
294
295 $this->storefront = StorefrontModel::of($data);
296 }
297
298 return $this->storefront;
299 }
300
301
305 public function setKey(?string $key): void
306 {
307 $this->key = $key;
308 }
309
313 public function setName(?LocalizedString $name): void
314 {
315 $this->name = $name;
316 }
317
321 public function setLanguages(?array $languages): void
322 {
323 $this->languages = $languages;
324 }
325
330 {
331 $this->countries = $countries;
332 }
333
338 {
339 $this->distributionChannels = $distributionChannels;
340 }
341
346 {
347 $this->supplyChannels = $supplyChannels;
348 }
349
354 {
355 $this->productSelections = $productSelections;
356 }
357
361 public function setCustom(?CustomFieldsDraft $custom): void
362 {
363 $this->custom = $custom;
364 }
365
369 public function setStorefront(?Storefront $storefront): void
370 {
371 $this->storefront = $storefront;
372 }
373}
setCountries(?StoreCountryCollection $countries)
setDistributionChannels(?ChannelResourceIdentifierCollection $distributionChannels)
__construct(?string $key=null, ?LocalizedString $name=null, ?array $languages=null, ?StoreCountryCollection $countries=null, ?ChannelResourceIdentifierCollection $distributionChannels=null, ?ChannelResourceIdentifierCollection $supplyChannels=null, ?ProductSelectionSettingDraftCollection $productSelections=null, ?CustomFieldsDraft $custom=null, ?Storefront $storefront=null)
setSupplyChannels(?ChannelResourceIdentifierCollection $supplyChannels)
setProductSelections(?ProductSelectionSettingDraftCollection $productSelections)
static fromArray(array $data)