commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ZoneDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
21 final class ZoneDraftBuilder implements Builder
22 {
27  private $key;
28 
33  private $name;
34 
39  private $description;
40 
45  private $locations;
46 
53  public function getKey()
54  {
55  return $this->key;
56  }
57 
64  public function getName()
65  {
66  return $this->name;
67  }
68 
75  public function getDescription()
76  {
77  return $this->description;
78  }
79 
86  public function getLocations()
87  {
88  return $this->locations;
89  }
90 
95  public function withKey(?string $key)
96  {
97  $this->key = $key;
98 
99  return $this;
100  }
101 
106  public function withName(?string $name)
107  {
108  $this->name = $name;
109 
110  return $this;
111  }
112 
117  public function withDescription(?string $description)
118  {
119  $this->description = $description;
120 
121  return $this;
122  }
123 
128  public function withLocations(?LocationCollection $locations)
129  {
130  $this->locations = $locations;
131 
132  return $this;
133  }
134 
135 
136  public function build(): ZoneDraft
137  {
138  return new ZoneDraftModel(
139  $this->key,
140  $this->name,
141  $this->description,
142  $this->locations
143  );
144  }
145 
146  public static function of(): ZoneDraftBuilder
147  {
148  return new self();
149  }
150 }
withLocations(?LocationCollection $locations)