commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
UserProvidedIdentifiersBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
24 {
29  private $key;
30 
35  private $externalId;
36 
41  private $orderNumber;
42 
47  private $customerNumber;
48 
53  private $sku;
54 
59  private $slug;
60 
65  private $containerAndKey;
66 
73  public function getKey()
74  {
75  return $this->key;
76  }
77 
84  public function getExternalId()
85  {
86  return $this->externalId;
87  }
88 
95  public function getOrderNumber()
96  {
97  return $this->orderNumber;
98  }
99 
106  public function getCustomerNumber()
107  {
108  return $this->customerNumber;
109  }
110 
117  public function getSku()
118  {
119  return $this->sku;
120  }
121 
128  public function getSlug()
129  {
130  return $this->slug instanceof LocalizedStringBuilder ? $this->slug->build() : $this->slug;
131  }
132 
139  public function getContainerAndKey()
140  {
141  return $this->containerAndKey instanceof ContainerAndKeyBuilder ? $this->containerAndKey->build() : $this->containerAndKey;
142  }
143 
148  public function withKey(?string $key)
149  {
150  $this->key = $key;
151 
152  return $this;
153  }
154 
159  public function withExternalId(?string $externalId)
160  {
161  $this->externalId = $externalId;
162 
163  return $this;
164  }
165 
170  public function withOrderNumber(?string $orderNumber)
171  {
172  $this->orderNumber = $orderNumber;
173 
174  return $this;
175  }
176 
181  public function withCustomerNumber(?string $customerNumber)
182  {
183  $this->customerNumber = $customerNumber;
184 
185  return $this;
186  }
187 
192  public function withSku(?string $sku)
193  {
194  $this->sku = $sku;
195 
196  return $this;
197  }
198 
203  public function withSlug(?LocalizedString $slug)
204  {
205  $this->slug = $slug;
206 
207  return $this;
208  }
209 
214  public function withContainerAndKey(?ContainerAndKey $containerAndKey)
215  {
216  $this->containerAndKey = $containerAndKey;
217 
218  return $this;
219  }
220 
225  public function withSlugBuilder(?LocalizedStringBuilder $slug)
226  {
227  $this->slug = $slug;
228 
229  return $this;
230  }
231 
236  public function withContainerAndKeyBuilder(?ContainerAndKeyBuilder $containerAndKey)
237  {
238  $this->containerAndKey = $containerAndKey;
239 
240  return $this;
241  }
242 
243  public function build(): UserProvidedIdentifiers
244  {
245  return new UserProvidedIdentifiersModel(
246  $this->key,
247  $this->externalId,
248  $this->orderNumber,
249  $this->customerNumber,
250  $this->sku,
251  $this->slug instanceof LocalizedStringBuilder ? $this->slug->build() : $this->slug,
252  $this->containerAndKey instanceof ContainerAndKeyBuilder ? $this->containerAndKey->build() : $this->containerAndKey
253  );
254  }
255 
256  public static function of(): UserProvidedIdentifiersBuilder
257  {
258  return new self();
259  }
260 }