commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
SetVariantAvailabilityChangeBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
19 
24 {
29  private $change;
30 
35  private $previousValue;
36 
41  private $nextValue;
42 
47  private $catalogData;
48 
53  private $variant;
54 
59  public function getChange()
60  {
61  return $this->change;
62  }
63 
70  public function getPreviousValue()
71  {
72  return $this->previousValue instanceof ProductVariantAvailabilityBuilder ? $this->previousValue->build() : $this->previousValue;
73  }
74 
81  public function getNextValue()
82  {
83  return $this->nextValue instanceof ProductVariantAvailabilityBuilder ? $this->nextValue->build() : $this->nextValue;
84  }
85 
95  public function getCatalogData()
96  {
97  return $this->catalogData;
98  }
99 
106  public function getVariant()
107  {
108  return $this->variant;
109  }
110 
115  public function withChange(?string $change)
116  {
117  $this->change = $change;
118 
119  return $this;
120  }
121 
126  public function withPreviousValue(?ProductVariantAvailability $previousValue)
127  {
128  $this->previousValue = $previousValue;
129 
130  return $this;
131  }
132 
137  public function withNextValue(?ProductVariantAvailability $nextValue)
138  {
139  $this->nextValue = $nextValue;
140 
141  return $this;
142  }
143 
148  public function withCatalogData(?string $catalogData)
149  {
150  $this->catalogData = $catalogData;
151 
152  return $this;
153  }
154 
159  public function withVariant(?string $variant)
160  {
161  $this->variant = $variant;
162 
163  return $this;
164  }
165 
171  {
172  $this->previousValue = $previousValue;
173 
174  return $this;
175  }
176 
182  {
183  $this->nextValue = $nextValue;
184 
185  return $this;
186  }
187 
189  {
191  $this->change,
192  $this->previousValue instanceof ProductVariantAvailabilityBuilder ? $this->previousValue->build() : $this->previousValue,
193  $this->nextValue instanceof ProductVariantAvailabilityBuilder ? $this->nextValue->build() : $this->nextValue,
194  $this->catalogData,
195  $this->variant
196  );
197  }
198 
199  public static function of(): SetVariantAvailabilityChangeBuilder
200  {
201  return new self();
202  }
203 }