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
OrderEdit
OrderExcerptModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\OrderEdit
;
10
11
use
Commercetools\Api\Models\Cart\TaxedPrice
;
12
use
Commercetools\Api\Models\Cart\TaxedPriceModel
;
13
use
Commercetools\Api\Models\Common\TypedMoney
;
14
use
Commercetools\Api\Models\Common\TypedMoneyModel
;
15
use
Commercetools\Base\DateTimeImmutableCollection
;
16
use
Commercetools\Base\JsonObject
;
17
use
Commercetools\Base\JsonObjectModel
;
18
use
Commercetools\Base\MapperFactory
;
19
use stdClass;
20
24
final
class
OrderExcerptModel
extends
JsonObjectModel
implements
OrderExcerpt
25
{
30
protected
$totalPrice
;
31
36
protected
$taxedPrice
;
37
42
protected
$version
;
43
44
48
public
function
__construct
(
49
?
TypedMoney
$totalPrice
=
null
,
50
?
TaxedPrice
$taxedPrice
=
null
,
51
?
int
$version
=
null
52
) {
53
$this->totalPrice =
$totalPrice
;
54
$this->taxedPrice =
$taxedPrice
;
55
$this->version =
$version
;
56
}
57
64
public
function
getTotalPrice
()
65
{
66
if
(is_null($this->totalPrice)) {
68
$data = $this->
raw
(self::FIELD_TOTAL_PRICE);
69
if
(is_null($data)) {
70
return
null
;
71
}
72
$className = TypedMoneyModel::resolveDiscriminatorClass($data);
73
$this->totalPrice = $className::of($data);
74
}
75
76
return
$this->totalPrice
;
77
}
78
85
public
function
getTaxedPrice
()
86
{
87
if
(is_null($this->taxedPrice)) {
89
$data = $this->
raw
(self::FIELD_TAXED_PRICE);
90
if
(is_null($data)) {
91
return
null
;
92
}
93
94
$this->taxedPrice = TaxedPriceModel::of($data);
95
}
96
97
return
$this->taxedPrice
;
98
}
99
106
public
function
getVersion
()
107
{
108
if
(is_null($this->version)) {
110
$data = $this->
raw
(self::FIELD_VERSION);
111
if
(is_null($data)) {
112
return
null
;
113
}
114
$this->version = (int) $data;
115
}
116
117
return
$this->version
;
118
}
119
120
124
public
function
setTotalPrice
(?
TypedMoney
$totalPrice
): void
125
{
126
$this->totalPrice =
$totalPrice
;
127
}
128
132
public
function
setTaxedPrice
(?
TaxedPrice
$taxedPrice
): void
133
{
134
$this->taxedPrice =
$taxedPrice
;
135
}
136
140
public
function
setVersion
(?
int
$version
): void
141
{
142
$this->version =
$version
;
143
}
144
}
Commercetools\Api\Models\Cart\TaxedPriceModel
Definition
TaxedPriceModel.php:23
Commercetools\Api\Models\Common\TypedMoneyModel
Definition
TypedMoneyModel.php:21
Commercetools\Api\Models\OrderEdit\OrderExcerptModel
Definition
OrderExcerptModel.php:25
Commercetools\Api\Models\OrderEdit\OrderExcerptModel\getTaxedPrice
getTaxedPrice()
Definition
OrderExcerptModel.php:85
Commercetools\Api\Models\OrderEdit\OrderExcerptModel\setTotalPrice
setTotalPrice(?TypedMoney $totalPrice)
Definition
OrderExcerptModel.php:124
Commercetools\Api\Models\OrderEdit\OrderExcerptModel\$version
$version
Definition
OrderExcerptModel.php:42
Commercetools\Api\Models\OrderEdit\OrderExcerptModel\setTaxedPrice
setTaxedPrice(?TaxedPrice $taxedPrice)
Definition
OrderExcerptModel.php:132
Commercetools\Api\Models\OrderEdit\OrderExcerptModel\$taxedPrice
$taxedPrice
Definition
OrderExcerptModel.php:36
Commercetools\Api\Models\OrderEdit\OrderExcerptModel\__construct
__construct(?TypedMoney $totalPrice=null, ?TaxedPrice $taxedPrice=null, ?int $version=null)
Definition
OrderExcerptModel.php:48
Commercetools\Api\Models\OrderEdit\OrderExcerptModel\getVersion
getVersion()
Definition
OrderExcerptModel.php:106
Commercetools\Api\Models\OrderEdit\OrderExcerptModel\setVersion
setVersion(?int $version)
Definition
OrderExcerptModel.php:140
Commercetools\Api\Models\OrderEdit\OrderExcerptModel\getTotalPrice
getTotalPrice()
Definition
OrderExcerptModel.php:64
Commercetools\Api\Models\OrderEdit\OrderExcerptModel\$totalPrice
$totalPrice
Definition
OrderExcerptModel.php:30
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\Cart\TaxedPrice
Definition
TaxedPrice.php:16
Commercetools\Api\Models\Common\TypedMoney
Definition
TypedMoney.php:15
Commercetools\Api\Models\OrderEdit\OrderExcerpt
Definition
OrderExcerpt.php:17
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\OrderEdit
Definition
OrderEdit.php:9
Generated by
1.9.8