commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
GeoLocationBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class GeoLocationBuilder implements Builder
22{
27 private $type;
28
33 private $coordinates;
34
39 public function getType()
40 {
41 return $this->type;
42 }
43
48 public function getCoordinates()
49 {
50 return $this->coordinates;
51 }
52
57 public function withType(?string $type)
58 {
59 $this->type = $type;
60
61 return $this;
62 }
63
68 public function withCoordinates(?array $coordinates)
69 {
70 $this->coordinates = $coordinates;
71
72 return $this;
73 }
74
75
76 public function build(): GeoLocation
77 {
78 return new GeoLocationModel(
79 $this->type,
80 $this->coordinates
81 );
82 }
83
84 public static function of(): GeoLocationBuilder
85 {
86 return new self();
87 }
88}