commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Models
ShippingMethod
CartValueTierModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\ShippingMethod
;
10
11
use
Commercetools\Api\Models\Common\Money
;
12
use
Commercetools\Api\Models\Common\MoneyModel
;
13
use
Commercetools\Base\DateTimeImmutableCollection
;
14
use
Commercetools\Base\JsonObject
;
15
use
Commercetools\Base\JsonObjectModel
;
16
use
Commercetools\Base\MapperFactory
;
17
use stdClass;
18
22
final
class
CartValueTierModel
extends
JsonObjectModel
implements
CartValueTier
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'CartValue'
;
29
protected
$type
;
30
35
protected
$minimumCentAmount
;
36
41
protected
$price
;
42
47
protected
$isMatching
;
48
49
53
public
function
__construct
(
54
?
int
$minimumCentAmount
=
null
,
55
?
Money
$price
=
null
,
56
?
bool
$isMatching
=
null
,
57
?
string
$type
=
null
58
) {
59
$this->minimumCentAmount =
$minimumCentAmount
;
60
$this->price =
$price
;
61
$this->isMatching =
$isMatching
;
62
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
63
}
64
69
public
function
getType
()
70
{
71
if
(is_null($this->type)) {
73
$data = $this->
raw
(self::FIELD_TYPE);
74
if
(is_null($data)) {
75
return
null
;
76
}
77
$this->type = (string) $data;
78
}
79
80
return
$this->type
;
81
}
82
89
public
function
getMinimumCentAmount
()
90
{
91
if
(is_null($this->minimumCentAmount)) {
93
$data = $this->
raw
(self::FIELD_MINIMUM_CENT_AMOUNT);
94
if
(is_null($data)) {
95
return
null
;
96
}
97
$this->minimumCentAmount = (int) $data;
98
}
99
100
return
$this->minimumCentAmount
;
101
}
102
109
public
function
getPrice
()
110
{
111
if
(is_null($this->price)) {
113
$data = $this->
raw
(self::FIELD_PRICE);
114
if
(is_null($data)) {
115
return
null
;
116
}
117
118
$this->price = MoneyModel::of($data);
119
}
120
121
return
$this->price
;
122
}
123
130
public
function
getIsMatching
()
131
{
132
if
(is_null($this->isMatching)) {
134
$data = $this->
raw
(self::FIELD_IS_MATCHING);
135
if
(is_null($data)) {
136
return
null
;
137
}
138
$this->isMatching = (bool) $data;
139
}
140
141
return
$this->isMatching
;
142
}
143
144
148
public
function
setMinimumCentAmount
(?
int
$minimumCentAmount
): void
149
{
150
$this->minimumCentAmount =
$minimumCentAmount
;
151
}
152
156
public
function
setPrice
(?
Money
$price
): void
157
{
158
$this->price =
$price
;
159
}
160
164
public
function
setIsMatching
(?
bool
$isMatching
): void
165
{
166
$this->isMatching =
$isMatching
;
167
}
168
}
Commercetools\Api\Models\Common\MoneyModel
Definition
MoneyModel.php:21
Commercetools\Api\Models\ShippingMethod\CartValueTierModel
Definition
CartValueTierModel.php:23
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\$minimumCentAmount
$minimumCentAmount
Definition
CartValueTierModel.php:35
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\getMinimumCentAmount
getMinimumCentAmount()
Definition
CartValueTierModel.php:89
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\setMinimumCentAmount
setMinimumCentAmount(?int $minimumCentAmount)
Definition
CartValueTierModel.php:148
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\getIsMatching
getIsMatching()
Definition
CartValueTierModel.php:130
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\getType
getType()
Definition
CartValueTierModel.php:69
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\__construct
__construct(?int $minimumCentAmount=null, ?Money $price=null, ?bool $isMatching=null, ?string $type=null)
Definition
CartValueTierModel.php:53
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\setIsMatching
setIsMatching(?bool $isMatching)
Definition
CartValueTierModel.php:164
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\$price
$price
Definition
CartValueTierModel.php:41
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\$type
$type
Definition
CartValueTierModel.php:29
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
CartValueTierModel.php:24
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\getPrice
getPrice()
Definition
CartValueTierModel.php:109
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\$isMatching
$isMatching
Definition
CartValueTierModel.php:47
Commercetools\Api\Models\ShippingMethod\CartValueTierModel\setPrice
setPrice(?Money $price)
Definition
CartValueTierModel.php:156
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\Api\Models\Common\Money
Definition
Money.php:15
Commercetools\Api\Models\ShippingMethod\CartValueTier
Definition
CartValueTier.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\ShippingMethod
Definition
CartClassificationTier.php:9
Generated by
1.9.8