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
Message
ReviewRatingSetMessagePayloadModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Message
;
10
11
use
Commercetools\Api\Models\Common\Reference
;
12
use
Commercetools\Api\Models\Common\ReferenceModel
;
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
ReviewRatingSetMessagePayloadModel
extends
JsonObjectModel
implements
ReviewRatingSetMessagePayload
23
{
24
public
const
DISCRIMINATOR_VALUE
=
'ReviewRatingSet'
;
29
protected
$type
;
30
35
protected
$oldRating
;
36
41
protected
$newRating
;
42
47
protected
$includedInStatistics
;
48
53
protected
$target
;
54
55
59
public
function
__construct
(
60
?
float
$oldRating
=
null
,
61
?
float
$newRating
=
null
,
62
?
bool
$includedInStatistics
=
null
,
63
?
Reference
$target
=
null
,
64
?
string
$type
=
null
65
) {
66
$this->oldRating =
$oldRating
;
67
$this->newRating =
$newRating
;
68
$this->includedInStatistics =
$includedInStatistics
;
69
$this->target =
$target
;
70
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
71
}
72
77
public
function
getType
()
78
{
79
if
(is_null($this->type)) {
81
$data = $this->
raw
(self::FIELD_TYPE);
82
if
(is_null($data)) {
83
return
null
;
84
}
85
$this->type = (string) $data;
86
}
87
88
return
$this->type
;
89
}
90
97
public
function
getOldRating
()
98
{
99
if
(is_null($this->oldRating)) {
101
$data = $this->
raw
(self::FIELD_OLD_RATING);
102
if
(is_null($data)) {
103
return
null
;
104
}
105
$this->oldRating = (float) $data;
106
}
107
108
return
$this->oldRating
;
109
}
110
117
public
function
getNewRating
()
118
{
119
if
(is_null($this->newRating)) {
121
$data = $this->
raw
(self::FIELD_NEW_RATING);
122
if
(is_null($data)) {
123
return
null
;
124
}
125
$this->newRating = (float) $data;
126
}
127
128
return
$this->newRating
;
129
}
130
137
public
function
getIncludedInStatistics
()
138
{
139
if
(is_null($this->includedInStatistics)) {
141
$data = $this->
raw
(self::FIELD_INCLUDED_IN_STATISTICS);
142
if
(is_null($data)) {
143
return
null
;
144
}
145
$this->includedInStatistics = (bool) $data;
146
}
147
148
return
$this->includedInStatistics
;
149
}
150
157
public
function
getTarget
()
158
{
159
if
(is_null($this->target)) {
161
$data = $this->
raw
(self::FIELD_TARGET);
162
if
(is_null($data)) {
163
return
null
;
164
}
165
$className = ReferenceModel::resolveDiscriminatorClass($data);
166
$this->target = $className::of($data);
167
}
168
169
return
$this->target
;
170
}
171
172
176
public
function
setOldRating
(?
float
$oldRating
): void
177
{
178
$this->oldRating =
$oldRating
;
179
}
180
184
public
function
setNewRating
(?
float
$newRating
): void
185
{
186
$this->newRating =
$newRating
;
187
}
188
192
public
function
setIncludedInStatistics
(?
bool
$includedInStatistics
): void
193
{
194
$this->includedInStatistics =
$includedInStatistics
;
195
}
196
200
public
function
setTarget
(?
Reference
$target
): void
201
{
202
$this->target =
$target
;
203
}
204
}
Commercetools\Api\Models\Common\ReferenceModel
Definition
ReferenceModel.php:91
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel
Definition
ReviewRatingSetMessagePayloadModel.php:23
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
ReviewRatingSetMessagePayloadModel.php:24
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\setTarget
setTarget(?Reference $target)
Definition
ReviewRatingSetMessagePayloadModel.php:200
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\__construct
__construct(?float $oldRating=null, ?float $newRating=null, ?bool $includedInStatistics=null, ?Reference $target=null, ?string $type=null)
Definition
ReviewRatingSetMessagePayloadModel.php:59
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\$includedInStatistics
$includedInStatistics
Definition
ReviewRatingSetMessagePayloadModel.php:47
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\setOldRating
setOldRating(?float $oldRating)
Definition
ReviewRatingSetMessagePayloadModel.php:176
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\getNewRating
getNewRating()
Definition
ReviewRatingSetMessagePayloadModel.php:117
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\setIncludedInStatistics
setIncludedInStatistics(?bool $includedInStatistics)
Definition
ReviewRatingSetMessagePayloadModel.php:192
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\getOldRating
getOldRating()
Definition
ReviewRatingSetMessagePayloadModel.php:97
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\setNewRating
setNewRating(?float $newRating)
Definition
ReviewRatingSetMessagePayloadModel.php:184
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\$newRating
$newRating
Definition
ReviewRatingSetMessagePayloadModel.php:41
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\$target
$target
Definition
ReviewRatingSetMessagePayloadModel.php:53
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\getType
getType()
Definition
ReviewRatingSetMessagePayloadModel.php:77
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\getTarget
getTarget()
Definition
ReviewRatingSetMessagePayloadModel.php:157
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\$type
$type
Definition
ReviewRatingSetMessagePayloadModel.php:29
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\getIncludedInStatistics
getIncludedInStatistics()
Definition
ReviewRatingSetMessagePayloadModel.php:137
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayloadModel\$oldRating
$oldRating
Definition
ReviewRatingSetMessagePayloadModel.php:35
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\Reference
Definition
Reference.php:50
Commercetools\Api\Models\Message\ReviewRatingSetMessagePayload
Definition
ReviewRatingSetMessagePayload.php:16
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Message
Definition
ApprovalFlowApprovedMessage.php:9
Generated by
1.9.8