commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ProductVariantDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
19use stdClass;
20
24final 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}