commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
Product
ProductVariantDraftBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Product
;
10
11
use
Commercetools\Api\Models\Common\AssetDraftCollection
;
12
use
Commercetools\Api\Models\Common\ImageCollection
;
13
use
Commercetools\Api\Models\Common\PriceDraftCollection
;
14
use
Commercetools\Base\Builder
;
15
use
Commercetools\Base\DateTimeImmutableCollection
;
16
use
Commercetools\Base\JsonObject
;
17
use
Commercetools\Base\JsonObjectModel
;
18
use
Commercetools\Base\MapperFactory
;
19
use stdClass;
20
24
final
class
ProductVariantDraftBuilder
implements
Builder
25
{
30
private
$sku;
31
36
private
$key;
37
42
private
$prices;
43
48
private
$attributes;
49
54
private
$images;
55
60
private
$assets;
61
68
public
function
getSku
()
69
{
70
return
$this->sku;
71
}
72
79
public
function
getKey
()
80
{
81
return
$this->key;
82
}
83
91
public
function
getPrices
()
92
{
93
return
$this->prices;
94
}
95
102
public
function
getAttributes
()
103
{
104
return
$this->attributes;
105
}
106
113
public
function
getImages
()
114
{
115
return
$this->images;
116
}
117
124
public
function
getAssets
()
125
{
126
return
$this->assets;
127
}
128
133
public
function
withSku
(?
string
$sku)
134
{
135
$this->sku = $sku;
136
137
return
$this;
138
}
139
144
public
function
withKey
(?
string
$key)
145
{
146
$this->key = $key;
147
148
return
$this;
149
}
150
155
public
function
withPrices
(?
PriceDraftCollection
$prices)
156
{
157
$this->prices = $prices;
158
159
return
$this;
160
}
161
166
public
function
withAttributes
(?
AttributeCollection
$attributes)
167
{
168
$this->attributes = $attributes;
169
170
return
$this;
171
}
172
177
public
function
withImages
(?
ImageCollection
$images)
178
{
179
$this->images = $images;
180
181
return
$this;
182
}
183
188
public
function
withAssets
(?
AssetDraftCollection
$assets)
189
{
190
$this->assets = $assets;
191
192
return
$this;
193
}
194
195
196
public
function
build
():
ProductVariantDraft
197
{
198
return
new
ProductVariantDraftModel
(
199
$this->sku,
200
$this->key,
201
$this->prices,
202
$this->attributes,
203
$this->images,
204
$this->assets
205
);
206
}
207
208
public
static
function
of
():
ProductVariantDraftBuilder
209
{
210
return
new
self
();
211
}
212
}
Commercetools\Api\Models\Common\AssetDraftCollection
Definition:
AssetDraftCollection.php:22
Commercetools\Api\Models\Common\ImageCollection
Definition:
ImageCollection.php:22
Commercetools\Api\Models\Common\PriceDraftCollection
Definition:
PriceDraftCollection.php:22
Commercetools\Api\Models\Product\AttributeCollection
Definition:
AttributeCollection.php:22
Commercetools\Api\Models\Product\ProductVariantDraftBuilder
Definition:
ProductVariantDraftBuilder.php:25
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\withPrices
withPrices(?PriceDraftCollection $prices)
Definition:
ProductVariantDraftBuilder.php:155
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\withImages
withImages(?ImageCollection $images)
Definition:
ProductVariantDraftBuilder.php:177
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\of
static of()
Definition:
ProductVariantDraftBuilder.php:208
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\withKey
withKey(?string $key)
Definition:
ProductVariantDraftBuilder.php:144
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\withSku
withSku(?string $sku)
Definition:
ProductVariantDraftBuilder.php:133
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\withAttributes
withAttributes(?AttributeCollection $attributes)
Definition:
ProductVariantDraftBuilder.php:166
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\getAttributes
getAttributes()
Definition:
ProductVariantDraftBuilder.php:102
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\getKey
getKey()
Definition:
ProductVariantDraftBuilder.php:79
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\getImages
getImages()
Definition:
ProductVariantDraftBuilder.php:113
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\withAssets
withAssets(?AssetDraftCollection $assets)
Definition:
ProductVariantDraftBuilder.php:188
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\getAssets
getAssets()
Definition:
ProductVariantDraftBuilder.php:124
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\build
build()
Definition:
ProductVariantDraftBuilder.php:196
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\getSku
getSku()
Definition:
ProductVariantDraftBuilder.php:68
Commercetools\Api\Models\Product\ProductVariantDraftBuilder\getPrices
getPrices()
Definition:
ProductVariantDraftBuilder.php:91
Commercetools\Api\Models\Product\ProductVariantDraftModel
Definition:
ProductVariantDraftModel.php:24
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\Product\ProductVariantDraft
Definition:
ProductVariantDraft.php:18
Commercetools\Base\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\Product
Definition:
AttributeAccessor.php:4
Generated by
1.9.1