commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ChannelDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
24use stdClass;
25
29final class ChannelDraftBuilder implements Builder
30{
35 private $key;
36
41 private $roles;
42
47 private $name;
48
53 private $description;
54
59 private $address;
60
65 private $custom;
66
71 private $geoLocation;
72
81 public function getKey()
82 {
83 return $this->key;
84 }
85
93 public function getRoles()
94 {
95 return $this->roles;
96 }
97
104 public function getName()
105 {
106 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
107 }
108
115 public function getDescription()
116 {
117 return $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description;
118 }
119
126 public function getAddress()
127 {
128 return $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address;
129 }
130
137 public function getCustom()
138 {
139 return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
140 }
141
149 public function getGeoLocation()
150 {
151 return $this->geoLocation instanceof GeoJsonBuilder ? $this->geoLocation->build() : $this->geoLocation;
152 }
153
158 public function withKey(?string $key)
159 {
160 $this->key = $key;
161
162 return $this;
163 }
164
169 public function withRoles(?array $roles)
170 {
171 $this->roles = $roles;
172
173 return $this;
174 }
175
180 public function withName(?LocalizedString $name)
181 {
182 $this->name = $name;
183
184 return $this;
185 }
186
191 public function withDescription(?LocalizedString $description)
192 {
193 $this->description = $description;
194
195 return $this;
196 }
197
202 public function withAddress(?BaseAddress $address)
203 {
204 $this->address = $address;
205
206 return $this;
207 }
208
213 public function withCustom(?CustomFieldsDraft $custom)
214 {
215 $this->custom = $custom;
216
217 return $this;
218 }
219
224 public function withGeoLocation(?GeoJson $geoLocation)
225 {
226 $this->geoLocation = $geoLocation;
227
228 return $this;
229 }
230
236 {
237 $this->name = $name;
238
239 return $this;
240 }
241
246 public function withDescriptionBuilder(?LocalizedStringBuilder $description)
247 {
248 $this->description = $description;
249
250 return $this;
251 }
252
257 public function withAddressBuilder(?BaseAddressBuilder $address)
258 {
259 $this->address = $address;
260
261 return $this;
262 }
263
269 {
270 $this->custom = $custom;
271
272 return $this;
273 }
274
279 public function withGeoLocationBuilder(?GeoJsonBuilder $geoLocation)
280 {
281 $this->geoLocation = $geoLocation;
282
283 return $this;
284 }
285
286 public function build(): ChannelDraft
287 {
288 return new ChannelDraftModel(
289 $this->key,
290 $this->roles,
291 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
292 $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description,
293 $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address,
294 $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom,
295 $this->geoLocation instanceof GeoJsonBuilder ? $this->geoLocation->build() : $this->geoLocation
296 );
297 }
298
299 public static function of(): ChannelDraftBuilder
300 {
301 return new self();
302 }
303}
withDescriptionBuilder(?LocalizedStringBuilder $description)