commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
StoreNameSetMessageBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
25 use DateTimeImmutable;
26 use stdClass;
27 
31 final class StoreNameSetMessageBuilder implements Builder
32 {
37  private $id;
38 
43  private $version;
44 
49  private $createdAt;
50 
55  private $lastModifiedAt;
56 
61  private $lastModifiedBy;
62 
67  private $createdBy;
68 
73  private $sequenceNumber;
74 
79  private $resource;
80 
85  private $resourceVersion;
86 
91  private $resourceUserProvidedIdentifiers;
92 
97  private $name;
98 
103  private $nameAllLocales;
104 
111  public function getId()
112  {
113  return $this->id;
114  }
115 
122  public function getVersion()
123  {
124  return $this->version;
125  }
126 
133  public function getCreatedAt()
134  {
135  return $this->createdAt;
136  }
137 
144  public function getLastModifiedAt()
145  {
146  return $this->lastModifiedAt;
147  }
148 
155  public function getLastModifiedBy()
156  {
157  return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy;
158  }
159 
166  public function getCreatedBy()
167  {
168  return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;
169  }
170 
178  public function getSequenceNumber()
179  {
180  return $this->sequenceNumber;
181  }
182 
189  public function getResource()
190  {
191  return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource;
192  }
193 
200  public function getResourceVersion()
201  {
202  return $this->resourceVersion;
203  }
204 
212  {
213  return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers;
214  }
215 
222  public function getName()
223  {
224  return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
225  }
226 
233  public function getNameAllLocales()
234  {
235  return $this->nameAllLocales;
236  }
237 
242  public function withId(?string $id)
243  {
244  $this->id = $id;
245 
246  return $this;
247  }
248 
253  public function withVersion(?int $version)
254  {
255  $this->version = $version;
256 
257  return $this;
258  }
259 
264  public function withCreatedAt(?DateTimeImmutable $createdAt)
265  {
266  $this->createdAt = $createdAt;
267 
268  return $this;
269  }
270 
275  public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt)
276  {
277  $this->lastModifiedAt = $lastModifiedAt;
278 
279  return $this;
280  }
281 
286  public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy)
287  {
288  $this->lastModifiedBy = $lastModifiedBy;
289 
290  return $this;
291  }
292 
297  public function withCreatedBy(?CreatedBy $createdBy)
298  {
299  $this->createdBy = $createdBy;
300 
301  return $this;
302  }
303 
308  public function withSequenceNumber(?int $sequenceNumber)
309  {
310  $this->sequenceNumber = $sequenceNumber;
311 
312  return $this;
313  }
314 
319  public function withResource(?Reference $resource)
320  {
321  $this->resource = $resource;
322 
323  return $this;
324  }
325 
330  public function withResourceVersion(?int $resourceVersion)
331  {
332  $this->resourceVersion = $resourceVersion;
333 
334  return $this;
335  }
336 
341  public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)
342  {
343  $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
344 
345  return $this;
346  }
347 
352  public function withName(?LocalizedString $name)
353  {
354  $this->name = $name;
355 
356  return $this;
357  }
358 
363  public function withNameAllLocales(?LocalizedStringCollection $nameAllLocales)
364  {
365  $this->nameAllLocales = $nameAllLocales;
366 
367  return $this;
368  }
369 
374  public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy)
375  {
376  $this->lastModifiedBy = $lastModifiedBy;
377 
378  return $this;
379  }
380 
385  public function withCreatedByBuilder(?CreatedByBuilder $createdBy)
386  {
387  $this->createdBy = $createdBy;
388 
389  return $this;
390  }
391 
396  public function withResourceBuilder(?ReferenceBuilder $resource)
397  {
398  $this->resource = $resource;
399 
400  return $this;
401  }
402 
407  public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)
408  {
409  $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers;
410 
411  return $this;
412  }
413 
418  public function withNameBuilder(?LocalizedStringBuilder $name)
419  {
420  $this->name = $name;
421 
422  return $this;
423  }
424 
425  public function build(): StoreNameSetMessage
426  {
427  return new StoreNameSetMessageModel(
428  $this->id,
429  $this->version,
430  $this->createdAt,
431  $this->lastModifiedAt,
432  $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy,
433  $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy,
434  $this->sequenceNumber,
435  $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource,
436  $this->resourceVersion,
437  $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers,
438  $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
439  $this->nameAllLocales
440  );
441  }
442 
443  public static function of(): StoreNameSetMessageBuilder
444  {
445  return new self();
446  }
447 }
withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers)
withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers)