commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
SetSearchKeywordsChangeBuilder.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 SearchKeywordsBuilder ? $this->previousValue->build() : $this->previousValue;
67  }
68 
75  public function getNextValue()
76  {
77  return $this->nextValue instanceof SearchKeywordsBuilder ? $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(?SearchKeywords $previousValue)
110  {
111  $this->previousValue = $previousValue;
112 
113  return $this;
114  }
115 
120  public function withNextValue(?SearchKeywords $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(?SearchKeywordsBuilder $previousValue)
143  {
144  $this->previousValue = $previousValue;
145 
146  return $this;
147  }
148 
153  public function withNextValueBuilder(?SearchKeywordsBuilder $nextValue)
154  {
155  $this->nextValue = $nextValue;
156 
157  return $this;
158  }
159 
160  public function build(): SetSearchKeywordsChange
161  {
162  return new SetSearchKeywordsChangeModel(
163  $this->change,
164  $this->previousValue instanceof SearchKeywordsBuilder ? $this->previousValue->build() : $this->previousValue,
165  $this->nextValue instanceof SearchKeywordsBuilder ? $this->nextValue->build() : $this->nextValue,
166  $this->catalogData
167  );
168  }
169 
170  public static function of(): SetSearchKeywordsChangeBuilder
171  {
172  return new self();
173  }
174 }