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
CartDiscount
CountOnLineItemUnitsModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\CartDiscount
;
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
CountOnLineItemUnitsModel
extends
JsonObjectModel
implements
CountOnLineItemUnits
21
{
22
public
const
DISCRIMINATOR_VALUE
=
'CountOnLineItemUnits'
;
27
protected
$type
;
28
33
protected
$predicate
;
34
39
protected
$minCount
;
40
45
protected
$maxCount
;
46
51
protected
$excludeCount
;
52
53
57
public
function
__construct
(
58
?
string
$predicate
=
null
,
59
?
int
$minCount
=
null
,
60
?
int
$maxCount
=
null
,
61
?
int
$excludeCount
=
null
,
62
?
string
$type
=
null
63
) {
64
$this->predicate =
$predicate
;
65
$this->minCount =
$minCount
;
66
$this->maxCount =
$maxCount
;
67
$this->excludeCount =
$excludeCount
;
68
$this->type =
$type
??
self::DISCRIMINATOR_VALUE
;
69
}
70
75
public
function
getType
()
76
{
77
if
(is_null($this->type)) {
79
$data = $this->
raw
(self::FIELD_TYPE);
80
if
(is_null($data)) {
81
return
null
;
82
}
83
$this->type = (string) $data;
84
}
85
86
return
$this->type
;
87
}
88
95
public
function
getPredicate
()
96
{
97
if
(is_null($this->predicate)) {
99
$data = $this->
raw
(self::FIELD_PREDICATE);
100
if
(is_null($data)) {
101
return
null
;
102
}
103
$this->predicate = (string) $data;
104
}
105
106
return
$this->predicate
;
107
}
108
115
public
function
getMinCount
()
116
{
117
if
(is_null($this->minCount)) {
119
$data = $this->
raw
(self::FIELD_MIN_COUNT);
120
if
(is_null($data)) {
121
return
null
;
122
}
123
$this->minCount = (int) $data;
124
}
125
126
return
$this->minCount
;
127
}
128
138
public
function
getMaxCount
()
139
{
140
if
(is_null($this->maxCount)) {
142
$data = $this->
raw
(self::FIELD_MAX_COUNT);
143
if
(is_null($data)) {
144
return
null
;
145
}
146
$this->maxCount = (int) $data;
147
}
148
149
return
$this->maxCount
;
150
}
151
162
public
function
getExcludeCount
()
163
{
164
if
(is_null($this->excludeCount)) {
166
$data = $this->
raw
(self::FIELD_EXCLUDE_COUNT);
167
if
(is_null($data)) {
168
return
null
;
169
}
170
$this->excludeCount = (int) $data;
171
}
172
173
return
$this->excludeCount
;
174
}
175
176
180
public
function
setPredicate
(?
string
$predicate
): void
181
{
182
$this->predicate =
$predicate
;
183
}
184
188
public
function
setMinCount
(?
int
$minCount
): void
189
{
190
$this->minCount =
$minCount
;
191
}
192
196
public
function
setMaxCount
(?
int
$maxCount
): void
197
{
198
$this->maxCount =
$maxCount
;
199
}
200
204
public
function
setExcludeCount
(?
int
$excludeCount
): void
205
{
206
$this->excludeCount =
$excludeCount
;
207
}
208
}
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel
Definition
CountOnLineItemUnitsModel.php:21
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\getMaxCount
getMaxCount()
Definition
CountOnLineItemUnitsModel.php:138
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\$type
$type
Definition
CountOnLineItemUnitsModel.php:27
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\$minCount
$minCount
Definition
CountOnLineItemUnitsModel.php:39
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\$predicate
$predicate
Definition
CountOnLineItemUnitsModel.php:33
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\getPredicate
getPredicate()
Definition
CountOnLineItemUnitsModel.php:95
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\setPredicate
setPredicate(?string $predicate)
Definition
CountOnLineItemUnitsModel.php:180
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\setMaxCount
setMaxCount(?int $maxCount)
Definition
CountOnLineItemUnitsModel.php:196
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\setMinCount
setMinCount(?int $minCount)
Definition
CountOnLineItemUnitsModel.php:188
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\getMinCount
getMinCount()
Definition
CountOnLineItemUnitsModel.php:115
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\getExcludeCount
getExcludeCount()
Definition
CountOnLineItemUnitsModel.php:162
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\setExcludeCount
setExcludeCount(?int $excludeCount)
Definition
CountOnLineItemUnitsModel.php:204
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\__construct
__construct(?string $predicate=null, ?int $minCount=null, ?int $maxCount=null, ?int $excludeCount=null, ?string $type=null)
Definition
CountOnLineItemUnitsModel.php:57
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\getType
getType()
Definition
CountOnLineItemUnitsModel.php:75
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\$excludeCount
$excludeCount
Definition
CountOnLineItemUnitsModel.php:51
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\$maxCount
$maxCount
Definition
CountOnLineItemUnitsModel.php:45
Commercetools\Api\Models\CartDiscount\CountOnLineItemUnitsModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
CountOnLineItemUnitsModel.php:22
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\CartDiscount\CountOnLineItemUnits
Definition
CountOnLineItemUnits.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\CartDiscount
Definition
CartDiscount.php:9
Generated by
1.9.8