commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-history
src
Models
Common
VariantBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\Common
;
10
11
use
Commercetools\Base\Builder
;
12
use
Commercetools\Base\DateTimeImmutableCollection
;
13
use
Commercetools\Base\JsonObject
;
14
use
Commercetools\Base\JsonObjectModel
;
15
use
Commercetools\Base\MapperFactory
;
16
use stdClass;
17
21
final
class
VariantBuilder
implements
Builder
22
{
27
private
$id;
28
33
private
$sku;
34
39
private
$key;
40
45
public
function
getId
()
46
{
47
return
$this->id;
48
}
49
54
public
function
getSku
()
55
{
56
return
$this->sku;
57
}
58
63
public
function
getKey
()
64
{
65
return
$this->key;
66
}
67
72
public
function
withId
(?
int
$id)
73
{
74
$this->
id
= $id;
75
76
return
$this;
77
}
78
83
public
function
withSku
(?
string
$sku)
84
{
85
$this->sku = $sku;
86
87
return
$this;
88
}
89
94
public
function
withKey
(?
string
$key)
95
{
96
$this->key = $key;
97
98
return
$this;
99
}
100
101
102
public
function
build
():
Variant
103
{
104
return
new
VariantModel
(
105
$this->
id
,
106
$this->sku,
107
$this->key
108
);
109
}
110
111
public
static
function
of
():
VariantBuilder
112
{
113
return
new
self
();
114
}
115
}
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\History\Models\Common\VariantBuilder
Definition:
VariantBuilder.php:22
Commercetools\History\Models\Common\VariantBuilder\getId
getId()
Definition:
VariantBuilder.php:45
Commercetools\History\Models\Common\VariantBuilder\getKey
getKey()
Definition:
VariantBuilder.php:63
Commercetools\History\Models\Common\VariantBuilder\withId
withId(?int $id)
Definition:
VariantBuilder.php:72
Commercetools\History\Models\Common\VariantBuilder\build
build()
Definition:
VariantBuilder.php:102
Commercetools\History\Models\Common\VariantBuilder\withKey
withKey(?string $key)
Definition:
VariantBuilder.php:94
Commercetools\History\Models\Common\VariantBuilder\of
static of()
Definition:
VariantBuilder.php:111
Commercetools\History\Models\Common\VariantBuilder\withSku
withSku(?string $sku)
Definition:
VariantBuilder.php:83
Commercetools\History\Models\Common\VariantBuilder\getSku
getSku()
Definition:
VariantBuilder.php:54
Commercetools\History\Models\Common\VariantModel
Definition:
VariantModel.php:21
Commercetools\Base\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\History\Models\Common\Variant
Definition:
Variant.php:15
Commercetools\History\Models\Common
Definition:
Address.php:9
Generated by
1.9.1