commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
VariantAttributesVariantBuilder.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
28 private $id;
29
34 private $sku;
35
40 private $key;
41
46 private $availability;
47
52 private $attributes;
53
60 public function getId()
61 {
62 return $this->id;
63 }
64
71 public function getSku()
72 {
73 return $this->sku;
74 }
75
82 public function getKey()
83 {
84 return $this->key;
85 }
86
94 public function getAvailability()
95 {
96 return $this->availability instanceof VariantAttributesAvailabilityBuilder ? $this->availability->build() : $this->availability;
97 }
98
106 public function getAttributes()
107 {
108 return $this->attributes;
109 }
110
115 public function withId(?string $id)
116 {
117 $this->id = $id;
118
119 return $this;
120 }
121
126 public function withSku(?string $sku)
127 {
128 $this->sku = $sku;
129
130 return $this;
131 }
132
137 public function withKey(?string $key)
138 {
139 $this->key = $key;
140
141 return $this;
142 }
143
148 public function withAvailability(?VariantAttributesAvailability $availability)
149 {
150 $this->availability = $availability;
151
152 return $this;
153 }
154
159 public function withAttributes(?AttributeCollection $attributes)
160 {
161 $this->attributes = $attributes;
162
163 return $this;
164 }
165
171 {
172 $this->availability = $availability;
173
174 return $this;
175 }
176
178 {
180 $this->id,
181 $this->sku,
182 $this->key,
183 $this->availability instanceof VariantAttributesAvailabilityBuilder ? $this->availability->build() : $this->availability,
184 $this->attributes
185 );
186 }
187
188 public static function of(): VariantAttributesVariantBuilder
189 {
190 return new self();
191 }
192}