commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ZoneDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class ZoneDraftModel extends JsonObjectModel implements ZoneDraft
21 {
26  protected $key;
27 
32  protected $name;
33 
38  protected $description;
39 
44  protected $locations;
45 
46 
50  public function __construct(
51  ?string $key = null,
52  ?string $name = null,
53  ?string $description = null,
55  ) {
56  $this->key = $key;
57  $this->name = $name;
58  $this->description = $description;
59  $this->locations = $locations;
60  }
61 
68  public function getKey()
69  {
70  if (is_null($this->key)) {
72  $data = $this->raw(self::FIELD_KEY);
73  if (is_null($data)) {
74  return null;
75  }
76  $this->key = (string) $data;
77  }
78 
79  return $this->key;
80  }
81 
88  public function getName()
89  {
90  if (is_null($this->name)) {
92  $data = $this->raw(self::FIELD_NAME);
93  if (is_null($data)) {
94  return null;
95  }
96  $this->name = (string) $data;
97  }
98 
99  return $this->name;
100  }
101 
108  public function getDescription()
109  {
110  if (is_null($this->description)) {
112  $data = $this->raw(self::FIELD_DESCRIPTION);
113  if (is_null($data)) {
114  return null;
115  }
116  $this->description = (string) $data;
117  }
118 
119  return $this->description;
120  }
121 
128  public function getLocations()
129  {
130  if (is_null($this->locations)) {
132  $data = $this->raw(self::FIELD_LOCATIONS);
133  if (is_null($data)) {
134  return null;
135  }
136  $this->locations = LocationCollection::fromArray($data);
137  }
138 
139  return $this->locations;
140  }
141 
142 
146  public function setKey(?string $key): void
147  {
148  $this->key = $key;
149  }
150 
154  public function setName(?string $name): void
155  {
156  $this->name = $name;
157  }
158 
162  public function setDescription(?string $description): void
163  {
164  $this->description = $description;
165  }
166 
171  {
172  $this->locations = $locations;
173  }
174 }
__construct(?string $key=null, ?string $name=null, ?string $description=null, ?LocationCollection $locations=null)
setLocations(?LocationCollection $locations)