commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
ShippingMethod
PriceFunctionModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\ShippingMethod
;
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
PriceFunctionModel
extends
JsonObjectModel
implements
PriceFunction
21
{
26
protected
$currencyCode
;
27
32
protected
$function
;
33
34
38
public
function
__construct
(
39
?
string
$currencyCode
=
null
,
40
?
string
$function
=
null
41
) {
42
$this->currencyCode =
$currencyCode
;
43
$this->
function
=
$function
;
44
}
45
52
public
function
getCurrencyCode
()
53
{
54
if
(is_null($this->currencyCode)) {
56
$data = $this->
raw
(self::FIELD_CURRENCY_CODE);
57
if
(is_null($data)) {
58
return
null
;
59
}
60
$this->currencyCode = (string) $data;
61
}
62
63
return
$this->currencyCode
;
64
}
65
73
public
function
getFunction
()
74
{
75
if
(is_null($this->
function
)) {
77
$data = $this->
raw
(self::FIELD_FUNCTION);
78
if
(is_null($data)) {
79
return
null
;
80
}
81
$this->
function
= (string) $data;
82
}
83
84
return
$this->function
;
85
}
86
87
91
public
function
setCurrencyCode
(?
string
$currencyCode
): void
92
{
93
$this->currencyCode =
$currencyCode
;
94
}
95
99
public
function
setFunction
(?
string
$function
): void
100
{
101
$this->
function
=
$function
;
102
}
103
}
Commercetools\Api\Models\ShippingMethod\PriceFunctionModel
Definition:
PriceFunctionModel.php:21
Commercetools\Api\Models\ShippingMethod\PriceFunctionModel\setCurrencyCode
setCurrencyCode(?string $currencyCode)
Definition:
PriceFunctionModel.php:91
Commercetools\Api\Models\ShippingMethod\PriceFunctionModel\getCurrencyCode
getCurrencyCode()
Definition:
PriceFunctionModel.php:52
Commercetools\Api\Models\ShippingMethod\PriceFunctionModel\__construct
__construct(?string $currencyCode=null, ?string $function=null)
Definition:
PriceFunctionModel.php:38
Commercetools\Api\Models\ShippingMethod\PriceFunctionModel\$function
$function
Definition:
PriceFunctionModel.php:32
Commercetools\Api\Models\ShippingMethod\PriceFunctionModel\getFunction
getFunction()
Definition:
PriceFunctionModel.php:73
Commercetools\Api\Models\ShippingMethod\PriceFunctionModel\$currencyCode
$currencyCode
Definition:
PriceFunctionModel.php:26
Commercetools\Api\Models\ShippingMethod\PriceFunctionModel\setFunction
setFunction(?string $function)
Definition:
PriceFunctionModel.php:99
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\ShippingMethod\PriceFunction
Definition:
PriceFunction.php:15
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\ShippingMethod
Definition:
CartClassificationTier.php:9
Generated by
1.9.1