commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-history
src
Models
Common
GeoLocationModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\Common
;
10
11
use
Commercetools\Base\DateTimeImmutableCollection
;
12
use
Commercetools\Base\JsonObject
;
13
use
Commercetools\Base\JsonObjectModel
;
14
use
Commercetools\Base\MapperFactory
;
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
}
Commercetools\Base\BaseJsonObject\raw
raw(string $field)
Definition:
BaseJsonObject.php:57
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\History\Models\Common\GeoLocationModel
Definition:
GeoLocationModel.php:21
Commercetools\History\Models\Common\GeoLocationModel\$type
$type
Definition:
GeoLocationModel.php:28
Commercetools\History\Models\Common\GeoLocationModel\setType
setType(?string $type)
Definition:
GeoLocationModel.php:89
Commercetools\History\Models\Common\GeoLocationModel\$coordinates
$coordinates
Definition:
GeoLocationModel.php:34
Commercetools\History\Models\Common\GeoLocationModel\getCoordinates
getCoordinates()
Definition:
GeoLocationModel.php:71
Commercetools\History\Models\Common\GeoLocationModel\__construct
__construct(?string $type=null, ?array $coordinates=null)
Definition:
GeoLocationModel.php:40
Commercetools\History\Models\Common\GeoLocationModel\setCoordinates
setCoordinates(?array $coordinates)
Definition:
GeoLocationModel.php:97
Commercetools\History\Models\Common\GeoLocationModel\getType
getType()
Definition:
GeoLocationModel.php:53
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\History\Models\Common\GeoLocation
Definition:
GeoLocation.php:15
Commercetools\History\Models\Common
Definition:
Address.php:9
Generated by
1.9.1