commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
GeoLocationModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class GeoLocationModel extends JsonObjectModel implements GeoLocation
21 {
22 
23 
28  protected $type;
29 
34  protected $coordinates;
35 
36 
40  public function __construct(
41  ?string $type = null,
42  ?array $coordinates = null
43  ) {
44  $this->type = $type;
45  $this->coordinates = $coordinates;
46 
47  }
48 
53  public function getType()
54  {
55  if (is_null($this->type)) {
57  $data = $this->raw(self::FIELD_TYPE);
58  if (is_null($data)) {
59  return null;
60  }
61  $this->type = (string) $data;
62  }
63 
64  return $this->type;
65  }
66 
71  public function getCoordinates()
72  {
73  if (is_null($this->coordinates)) {
75  $data = $this->raw(self::FIELD_COORDINATES);
76  if (is_null($data)) {
77  return null;
78  }
79  $this->coordinates = $data;
80  }
81 
82  return $this->coordinates;
83  }
84 
85 
89  public function setType(?string $type): void
90  {
91  $this->type = $type;
92  }
93 
97  public function setCoordinates(?array $coordinates): void
98  {
99  $this->coordinates = $coordinates;
100  }
101 
102 
103 
104 }
__construct(?string $type=null, ?array $coordinates=null)