commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ChangeSlugChangeBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
19
23final class ChangeSlugChangeBuilder implements Builder
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 LocalizedStringBuilder ? $this->previousValue->build() : $this->previousValue;
67 }
68
75 public function getNextValue()
76 {
77 return $this->nextValue instanceof LocalizedStringBuilder ? $this->nextValue->build() : $this->nextValue;
78 }
79
90 public function getCatalogData()
91 {
92 return $this->catalogData;
93 }
94
99 public function withChange(?string $change)
100 {
101 $this->change = $change;
102
103 return $this;
104 }
105
110 public function withPreviousValue(?LocalizedString $previousValue)
111 {
112 $this->previousValue = $previousValue;
113
114 return $this;
115 }
116
121 public function withNextValue(?LocalizedString $nextValue)
122 {
123 $this->nextValue = $nextValue;
124
125 return $this;
126 }
127
132 public function withCatalogData(?string $catalogData)
133 {
134 $this->catalogData = $catalogData;
135
136 return $this;
137 }
138
143 public function withPreviousValueBuilder(?LocalizedStringBuilder $previousValue)
144 {
145 $this->previousValue = $previousValue;
146
147 return $this;
148 }
149
154 public function withNextValueBuilder(?LocalizedStringBuilder $nextValue)
155 {
156 $this->nextValue = $nextValue;
157
158 return $this;
159 }
160
161 public function build(): ChangeSlugChange
162 {
163 return new ChangeSlugChangeModel(
164 $this->change,
165 $this->previousValue instanceof LocalizedStringBuilder ? $this->previousValue->build() : $this->previousValue,
166 $this->nextValue instanceof LocalizedStringBuilder ? $this->nextValue->build() : $this->nextValue,
167 $this->catalogData
168 );
169 }
170
171 public static function of(): ChangeSlugChangeBuilder
172 {
173 return new self();
174 }
175}