commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
StoreCreatedMessagePayloadModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
22 use stdClass;
23 
28 {
29  public const DISCRIMINATOR_VALUE = 'StoreCreated';
34  protected $type;
35 
40  protected $name;
41 
46  protected $languages;
47 
52  protected $countries;
53 
59 
64  protected $supplyChannels;
65 
70  protected $productSelections;
71 
76  protected $custom;
77 
78 
82  public function __construct(
83  ?LocalizedString $name = null,
84  ?array $languages = null,
89  ?CustomFields $custom = null,
90  ?string $type = null
91  ) {
92  $this->name = $name;
93  $this->languages = $languages;
94  $this->countries = $countries;
95  $this->distributionChannels = $distributionChannels;
96  $this->supplyChannels = $supplyChannels;
97  $this->productSelections = $productSelections;
98  $this->custom = $custom;
99  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
100  }
101 
106  public function getType()
107  {
108  if (is_null($this->type)) {
110  $data = $this->raw(self::FIELD_TYPE);
111  if (is_null($data)) {
112  return null;
113  }
114  $this->type = (string) $data;
115  }
116 
117  return $this->type;
118  }
119 
126  public function getName()
127  {
128  if (is_null($this->name)) {
130  $data = $this->raw(self::FIELD_NAME);
131  if (is_null($data)) {
132  return null;
133  }
134 
135  $this->name = LocalizedStringModel::of($data);
136  }
137 
138  return $this->name;
139  }
140 
147  public function getLanguages()
148  {
149  if (is_null($this->languages)) {
151  $data = $this->raw(self::FIELD_LANGUAGES);
152  if (is_null($data)) {
153  return null;
154  }
155  $this->languages = $data;
156  }
157 
158  return $this->languages;
159  }
160 
167  public function getCountries()
168  {
169  if (is_null($this->countries)) {
171  $data = $this->raw(self::FIELD_COUNTRIES);
172  if (is_null($data)) {
173  return null;
174  }
175  $this->countries = StoreCountryCollection::fromArray($data);
176  }
177 
178  return $this->countries;
179  }
180 
187  public function getDistributionChannels()
188  {
189  if (is_null($this->distributionChannels)) {
191  $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNELS);
192  if (is_null($data)) {
193  return null;
194  }
195  $this->distributionChannels = ChannelReferenceCollection::fromArray($data);
196  }
197 
199  }
200 
207  public function getSupplyChannels()
208  {
209  if (is_null($this->supplyChannels)) {
211  $data = $this->raw(self::FIELD_SUPPLY_CHANNELS);
212  if (is_null($data)) {
213  return null;
214  }
215  $this->supplyChannels = ChannelReferenceCollection::fromArray($data);
216  }
217 
218  return $this->supplyChannels;
219  }
220 
227  public function getProductSelections()
228  {
229  if (is_null($this->productSelections)) {
231  $data = $this->raw(self::FIELD_PRODUCT_SELECTIONS);
232  if (is_null($data)) {
233  return null;
234  }
235  $this->productSelections = ProductSelectionSettingCollection::fromArray($data);
236  }
237 
239  }
240 
247  public function getCustom()
248  {
249  if (is_null($this->custom)) {
251  $data = $this->raw(self::FIELD_CUSTOM);
252  if (is_null($data)) {
253  return null;
254  }
255 
256  $this->custom = CustomFieldsModel::of($data);
257  }
258 
259  return $this->custom;
260  }
261 
262 
266  public function setName(?LocalizedString $name): void
267  {
268  $this->name = $name;
269  }
270 
274  public function setLanguages(?array $languages): void
275  {
276  $this->languages = $languages;
277  }
278 
283  {
284  $this->countries = $countries;
285  }
286 
291  {
292  $this->distributionChannels = $distributionChannels;
293  }
294 
299  {
300  $this->supplyChannels = $supplyChannels;
301  }
302 
307  {
308  $this->productSelections = $productSelections;
309  }
310 
314  public function setCustom(?CustomFields $custom): void
315  {
316  $this->custom = $custom;
317  }
318 }
setProductSelections(?ProductSelectionSettingCollection $productSelections)
__construct(?LocalizedString $name=null, ?array $languages=null, ?StoreCountryCollection $countries=null, ?ChannelReferenceCollection $distributionChannels=null, ?ChannelReferenceCollection $supplyChannels=null, ?ProductSelectionSettingCollection $productSelections=null, ?CustomFields $custom=null, ?string $type=null)
setDistributionChannels(?ChannelReferenceCollection $distributionChannels)
static of($data=null)
Definition: MapperMap.php:45