commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
ShippingMethod
ShippingMethodDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\ShippingMethod
;
10
11
use
Commercetools\Api\Models\Common\LocalizedString
;
12
use
Commercetools\Api\Models\Common\LocalizedStringBuilder
;
13
use
Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier
;
14
use
Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierBuilder
;
15
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
16
use
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
;
17
use
Commercetools\Base\Builder
;
18
use
Commercetools\Base\DateTimeImmutableCollection
;
19
use
Commercetools\Base\JsonObject
;
20
use
Commercetools\Base\JsonObjectModel
;
21
use
Commercetools\Base\MapperFactory
;
22
use stdClass;
23
27
final
class
ShippingMethodDraftBuilder
implements
Builder
28
{
33
private
$key;
34
39
private
$name;
40
45
private
$localizedName;
46
51
private
$description;
52
57
private
$localizedDescription;
58
63
private
$taxCategory;
64
69
private
$zoneRates;
70
75
private
$active;
76
81
private
$isDefault;
82
87
private
$predicate;
88
93
private
$custom;
94
101
public
function
getKey
()
102
{
103
return
$this->key;
104
}
105
112
public
function
getName
()
113
{
114
return
$this->name;
115
}
116
123
public
function
getLocalizedName
()
124
{
125
return
$this->localizedName instanceof
LocalizedStringBuilder
? $this->localizedName->
build
() : $this->localizedName;
126
}
127
134
public
function
getDescription
()
135
{
136
return
$this->description;
137
}
138
145
public
function
getLocalizedDescription
()
146
{
147
return
$this->localizedDescription instanceof
LocalizedStringBuilder
? $this->localizedDescription->
build
() : $this->localizedDescription;
148
}
149
156
public
function
getTaxCategory
()
157
{
158
return
$this->taxCategory instanceof
TaxCategoryResourceIdentifierBuilder
? $this->taxCategory->
build
() : $this->taxCategory;
159
}
160
167
public
function
getZoneRates
()
168
{
169
return
$this->zoneRates;
170
}
171
178
public
function
getActive
()
179
{
180
return
$this->active;
181
}
182
189
public
function
getIsDefault
()
190
{
191
return
$this->isDefault;
192
}
193
200
public
function
getPredicate
()
201
{
202
return
$this->predicate;
203
}
204
211
public
function
getCustom
()
212
{
213
return
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom;
214
}
215
220
public
function
withKey
(?
string
$key)
221
{
222
$this->key = $key;
223
224
return
$this;
225
}
226
231
public
function
withName
(?
string
$name)
232
{
233
$this->name = $name;
234
235
return
$this;
236
}
237
242
public
function
withLocalizedName
(?
LocalizedString
$localizedName)
243
{
244
$this->localizedName = $localizedName;
245
246
return
$this;
247
}
248
253
public
function
withDescription
(?
string
$description)
254
{
255
$this->description = $description;
256
257
return
$this;
258
}
259
264
public
function
withLocalizedDescription
(?
LocalizedString
$localizedDescription)
265
{
266
$this->localizedDescription = $localizedDescription;
267
268
return
$this;
269
}
270
275
public
function
withTaxCategory
(?
TaxCategoryResourceIdentifier
$taxCategory)
276
{
277
$this->taxCategory = $taxCategory;
278
279
return
$this;
280
}
281
286
public
function
withZoneRates
(?
ZoneRateDraftCollection
$zoneRates)
287
{
288
$this->zoneRates = $zoneRates;
289
290
return
$this;
291
}
292
297
public
function
withActive
(?
bool
$active)
298
{
299
$this->active = $active;
300
301
return
$this;
302
}
303
308
public
function
withIsDefault
(?
bool
$isDefault)
309
{
310
$this->isDefault = $isDefault;
311
312
return
$this;
313
}
314
319
public
function
withPredicate
(?
string
$predicate)
320
{
321
$this->predicate = $predicate;
322
323
return
$this;
324
}
325
330
public
function
withCustom
(?
CustomFieldsDraft
$custom)
331
{
332
$this->custom = $custom;
333
334
return
$this;
335
}
336
341
public
function
withLocalizedNameBuilder
(?
LocalizedStringBuilder
$localizedName)
342
{
343
$this->localizedName = $localizedName;
344
345
return
$this;
346
}
347
352
public
function
withLocalizedDescriptionBuilder
(?
LocalizedStringBuilder
$localizedDescription)
353
{
354
$this->localizedDescription = $localizedDescription;
355
356
return
$this;
357
}
358
363
public
function
withTaxCategoryBuilder
(?
TaxCategoryResourceIdentifierBuilder
$taxCategory)
364
{
365
$this->taxCategory = $taxCategory;
366
367
return
$this;
368
}
369
374
public
function
withCustomBuilder
(?
CustomFieldsDraftBuilder
$custom)
375
{
376
$this->custom = $custom;
377
378
return
$this;
379
}
380
381
public
function
build
():
ShippingMethodDraft
382
{
383
return
new
ShippingMethodDraftModel
(
384
$this->key,
385
$this->name,
386
$this->localizedName instanceof
LocalizedStringBuilder
? $this->localizedName->
build
() : $this->localizedName,
387
$this->description,
388
$this->localizedDescription instanceof
LocalizedStringBuilder
? $this->localizedDescription->
build
() : $this->localizedDescription,
389
$this->taxCategory instanceof
TaxCategoryResourceIdentifierBuilder
? $this->taxCategory->
build
() : $this->taxCategory,
390
$this->zoneRates,
391
$this->active,
392
$this->isDefault,
393
$this->predicate,
394
$this->custom instanceof
CustomFieldsDraftBuilder
? $this->custom->
build
() : $this->custom
395
);
396
}
397
398
public
static
function
of
():
ShippingMethodDraftBuilder
399
{
400
return
new
self
();
401
}
402
}
Commercetools\Api\Models\Common\LocalizedStringBuilder
Definition
LocalizedStringBuilder.php:20
Commercetools\Api\Models\Common\LocalizedStringBuilder\build
build()
Definition
LocalizedStringBuilder.php:42
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder
Definition
ShippingMethodDraftBuilder.php:28
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\getDescription
getDescription()
Definition
ShippingMethodDraftBuilder.php:134
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withLocalizedDescriptionBuilder
withLocalizedDescriptionBuilder(?LocalizedStringBuilder $localizedDescription)
Definition
ShippingMethodDraftBuilder.php:352
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withLocalizedDescription
withLocalizedDescription(?LocalizedString $localizedDescription)
Definition
ShippingMethodDraftBuilder.php:264
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\getZoneRates
getZoneRates()
Definition
ShippingMethodDraftBuilder.php:167
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withIsDefault
withIsDefault(?bool $isDefault)
Definition
ShippingMethodDraftBuilder.php:308
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withCustom
withCustom(?CustomFieldsDraft $custom)
Definition
ShippingMethodDraftBuilder.php:330
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withKey
withKey(?string $key)
Definition
ShippingMethodDraftBuilder.php:220
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withActive
withActive(?bool $active)
Definition
ShippingMethodDraftBuilder.php:297
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\getLocalizedName
getLocalizedName()
Definition
ShippingMethodDraftBuilder.php:123
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\getActive
getActive()
Definition
ShippingMethodDraftBuilder.php:178
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\getKey
getKey()
Definition
ShippingMethodDraftBuilder.php:101
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\getName
getName()
Definition
ShippingMethodDraftBuilder.php:112
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\getPredicate
getPredicate()
Definition
ShippingMethodDraftBuilder.php:200
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withTaxCategory
withTaxCategory(?TaxCategoryResourceIdentifier $taxCategory)
Definition
ShippingMethodDraftBuilder.php:275
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\build
build()
Definition
ShippingMethodDraftBuilder.php:381
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\getCustom
getCustom()
Definition
ShippingMethodDraftBuilder.php:211
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withName
withName(?string $name)
Definition
ShippingMethodDraftBuilder.php:231
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\of
static of()
Definition
ShippingMethodDraftBuilder.php:398
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withZoneRates
withZoneRates(?ZoneRateDraftCollection $zoneRates)
Definition
ShippingMethodDraftBuilder.php:286
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\getIsDefault
getIsDefault()
Definition
ShippingMethodDraftBuilder.php:189
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withDescription
withDescription(?string $description)
Definition
ShippingMethodDraftBuilder.php:253
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withPredicate
withPredicate(?string $predicate)
Definition
ShippingMethodDraftBuilder.php:319
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withCustomBuilder
withCustomBuilder(?CustomFieldsDraftBuilder $custom)
Definition
ShippingMethodDraftBuilder.php:374
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\getTaxCategory
getTaxCategory()
Definition
ShippingMethodDraftBuilder.php:156
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withTaxCategoryBuilder
withTaxCategoryBuilder(?TaxCategoryResourceIdentifierBuilder $taxCategory)
Definition
ShippingMethodDraftBuilder.php:363
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withLocalizedName
withLocalizedName(?LocalizedString $localizedName)
Definition
ShippingMethodDraftBuilder.php:242
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\getLocalizedDescription
getLocalizedDescription()
Definition
ShippingMethodDraftBuilder.php:145
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftBuilder\withLocalizedNameBuilder
withLocalizedNameBuilder(?LocalizedStringBuilder $localizedName)
Definition
ShippingMethodDraftBuilder.php:341
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraftModel
Definition
ShippingMethodDraftModel.php:27
Commercetools\Api\Models\ShippingMethod\ZoneRateDraftCollection
Definition
ZoneRateDraftCollection.php:22
Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierBuilder
Definition
TaxCategoryResourceIdentifierBuilder.php:24
Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierBuilder\build
build()
Definition
TaxCategoryResourceIdentifierBuilder.php:82
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder
Definition
CustomFieldsDraftBuilder.php:22
Commercetools\Api\Models\Type\CustomFieldsDraftBuilder\build
build()
Definition
CustomFieldsDraftBuilder.php:101
Commercetools\Base\DateTimeImmutableCollection
Definition
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition
MapperFactory.php:16
Commercetools\Api\Models\Common\LocalizedString
Definition
LocalizedString.php:14
Commercetools\Api\Models\ShippingMethod\ShippingMethodDraft
Definition
ShippingMethodDraft.php:18
Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier
Definition
TaxCategoryResourceIdentifier.php:16
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition
CustomFieldsDraft.php:15
Commercetools\Base\Builder
Definition
Builder.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\ShippingMethod
Definition
CartClassificationTier.php:9
Generated by
1.9.8