commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ChangeMasterVariantChangeBuilder.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  public function getChange()
54  {
55  return $this->change;
56  }
57 
64  public function getPreviousValue()
65  {
66  return $this->previousValue instanceof VariantBuilder ? $this->previousValue->build() : $this->previousValue;
67  }
68 
75  public function getNextValue()
76  {
77  return $this->nextValue instanceof VariantBuilder ? $this->nextValue->build() : $this->nextValue;
78  }
79 
89  public function getCatalogData()
90  {
91  return $this->catalogData;
92  }
93 
98  public function withChange(?string $change)
99  {
100  $this->change = $change;
101 
102  return $this;
103  }
104 
109  public function withPreviousValue(?Variant $previousValue)
110  {
111  $this->previousValue = $previousValue;
112 
113  return $this;
114  }
115 
120  public function withNextValue(?Variant $nextValue)
121  {
122  $this->nextValue = $nextValue;
123 
124  return $this;
125  }
126 
131  public function withCatalogData(?string $catalogData)
132  {
133  $this->catalogData = $catalogData;
134 
135  return $this;
136  }
137 
142  public function withPreviousValueBuilder(?VariantBuilder $previousValue)
143  {
144  $this->previousValue = $previousValue;
145 
146  return $this;
147  }
148 
153  public function withNextValueBuilder(?VariantBuilder $nextValue)
154  {
155  $this->nextValue = $nextValue;
156 
157  return $this;
158  }
159 
160  public function build(): ChangeMasterVariantChange
161  {
163  $this->change,
164  $this->previousValue instanceof VariantBuilder ? $this->previousValue->build() : $this->previousValue,
165  $this->nextValue instanceof VariantBuilder ? $this->nextValue->build() : $this->nextValue,
166  $this->catalogData
167  );
168  }
169 
170  public static function of(): ChangeMasterVariantChangeBuilder
171  {
172  return new self();
173  }
174 }