commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-history
src
Models
Change
AddPriceChangeModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\Change
;
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
use
Commercetools\History\Models\Common\Price
;
17
use
Commercetools\History\Models\Common\PriceModel
;
18
22
final
class
AddPriceChangeModel
extends
JsonObjectModel
implements
AddPriceChange
23
{
24
25
public
const
DISCRIMINATOR_VALUE
=
'AddPriceChange'
;
30
protected
$type
;
31
36
protected
$change
;
37
42
protected
$nextValue
;
43
48
protected
$catalogData
;
49
54
protected
$priceId
;
55
56
60
public
function
__construct
(
61
?
string
$change
=
null
,
62
?
Price
$nextValue
=
null
,
63
?
string
$catalogData
=
null
,
64
?
string
$priceId
=
null
,
65
?
string
$type
=
null
66
) {
67
$this->change =
$change
;
68
$this->nextValue =
$nextValue
;
69
$this->catalogData =
$catalogData
;
70
$this->priceId =
$priceId
;
71
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
72
}
73
78
public
function
getType
()
79
{
80
if
(is_null($this->type)) {
82
$data = $this->
raw
(self::FIELD_TYPE);
83
if
(is_null($data)) {
84
return
null
;
85
}
86
$this->type = (string) $data;
87
}
88
89
return
$this->type
;
90
}
91
96
public
function
getChange
()
97
{
98
if
(is_null($this->change)) {
100
$data = $this->
raw
(self::FIELD_CHANGE);
101
if
(is_null($data)) {
102
return
null
;
103
}
104
$this->change = (string) $data;
105
}
106
107
return
$this->change
;
108
}
109
116
public
function
getNextValue
()
117
{
118
if
(is_null($this->nextValue)) {
120
$data = $this->
raw
(self::FIELD_NEXT_VALUE);
121
if
(is_null($data)) {
122
return
null
;
123
}
124
125
$this->nextValue = PriceModel::of($data);
126
}
127
128
return
$this->nextValue
;
129
}
130
140
public
function
getCatalogData
()
141
{
142
if
(is_null($this->catalogData)) {
144
$data = $this->
raw
(self::FIELD_CATALOG_DATA);
145
if
(is_null($data)) {
146
return
null
;
147
}
148
$this->catalogData = (string) $data;
149
}
150
151
return
$this->catalogData
;
152
}
153
160
public
function
getPriceId
()
161
{
162
if
(is_null($this->priceId)) {
164
$data = $this->
raw
(self::FIELD_PRICE_ID);
165
if
(is_null($data)) {
166
return
null
;
167
}
168
$this->priceId = (string) $data;
169
}
170
171
return
$this->priceId
;
172
}
173
174
178
public
function
setChange
(?
string
$change
): void
179
{
180
$this->change =
$change
;
181
}
182
186
public
function
setNextValue
(?
Price
$nextValue
): void
187
{
188
$this->nextValue =
$nextValue
;
189
}
190
194
public
function
setCatalogData
(?
string
$catalogData
): void
195
{
196
$this->catalogData =
$catalogData
;
197
}
198
202
public
function
setPriceId
(?
string
$priceId
): void
203
{
204
$this->priceId =
$priceId
;
205
}
206
207
208
209
}
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\Change\AddPriceChangeModel
Definition
AddPriceChangeModel.php:23
Commercetools\History\Models\Change\AddPriceChangeModel\__construct
__construct(?string $change=null, ?Price $nextValue=null, ?string $catalogData=null, ?string $priceId=null, ?string $type=null)
Definition
AddPriceChangeModel.php:60
Commercetools\History\Models\Change\AddPriceChangeModel\setChange
setChange(?string $change)
Definition
AddPriceChangeModel.php:178
Commercetools\History\Models\Change\AddPriceChangeModel\$priceId
$priceId
Definition
AddPriceChangeModel.php:54
Commercetools\History\Models\Change\AddPriceChangeModel\getCatalogData
getCatalogData()
Definition
AddPriceChangeModel.php:140
Commercetools\History\Models\Change\AddPriceChangeModel\getPriceId
getPriceId()
Definition
AddPriceChangeModel.php:160
Commercetools\History\Models\Change\AddPriceChangeModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
AddPriceChangeModel.php:25
Commercetools\History\Models\Change\AddPriceChangeModel\setNextValue
setNextValue(?Price $nextValue)
Definition
AddPriceChangeModel.php:186
Commercetools\History\Models\Change\AddPriceChangeModel\$nextValue
$nextValue
Definition
AddPriceChangeModel.php:42
Commercetools\History\Models\Change\AddPriceChangeModel\$catalogData
$catalogData
Definition
AddPriceChangeModel.php:48
Commercetools\History\Models\Change\AddPriceChangeModel\setCatalogData
setCatalogData(?string $catalogData)
Definition
AddPriceChangeModel.php:194
Commercetools\History\Models\Change\AddPriceChangeModel\$change
$change
Definition
AddPriceChangeModel.php:36
Commercetools\History\Models\Change\AddPriceChangeModel\getType
getType()
Definition
AddPriceChangeModel.php:78
Commercetools\History\Models\Change\AddPriceChangeModel\getChange
getChange()
Definition
AddPriceChangeModel.php:96
Commercetools\History\Models\Change\AddPriceChangeModel\setPriceId
setPriceId(?string $priceId)
Definition
AddPriceChangeModel.php:202
Commercetools\History\Models\Change\AddPriceChangeModel\getNextValue
getNextValue()
Definition
AddPriceChangeModel.php:116
Commercetools\History\Models\Change\AddPriceChangeModel\$type
$type
Definition
AddPriceChangeModel.php:30
Commercetools\History\Models\Common\PriceModel
Definition
PriceModel.php:21
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\Change\AddPriceChange
Definition
AddPriceChange.php:16
Commercetools\History\Models\Common\Price
Definition
Price.php:15
Commercetools\History\Models\Change
Definition
AddAddressChange.php:9
Generated by
1.9.8