commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CountOnLineItemUnitsModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
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}
__construct(?string $predicate=null, ?int $minCount=null, ?int $maxCount=null, ?int $excludeCount=null, ?string $type=null)