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
ChangeValue
ChangeTargetPatternChangeValueModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\History\Models\ChangeValue
;
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\CartDiscount\PatternComponentCollection
;
17
21
final
class
ChangeTargetPatternChangeValueModel
extends
JsonObjectModel
implements
ChangeTargetPatternChangeValue
22
{
23
24
public
const
DISCRIMINATOR_VALUE
=
'pattern'
;
29
protected
$type
;
30
35
protected
$triggerPattern
;
36
41
protected
$targetPattern
;
42
47
protected
$maxOccurrence
;
48
53
protected
$selectionMode
;
54
55
59
public
function
__construct
(
60
?
PatternComponentCollection
$triggerPattern
=
null
,
61
?
PatternComponentCollection
$targetPattern
=
null
,
62
?
int
$maxOccurrence
=
null
,
63
?
string
$selectionMode
=
null
,
64
?
string
$type
=
null
65
) {
66
$this->triggerPattern =
$triggerPattern
;
67
$this->targetPattern =
$targetPattern
;
68
$this->maxOccurrence =
$maxOccurrence
;
69
$this->selectionMode =
$selectionMode
;
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
getTriggerPattern
()
98
{
99
if
(is_null($this->triggerPattern)) {
101
$data = $this->
raw
(self::FIELD_TRIGGER_PATTERN);
102
if
(is_null($data)) {
103
return
null
;
104
}
105
$this->triggerPattern = PatternComponentCollection::fromArray($data);
106
}
107
108
return
$this->triggerPattern
;
109
}
110
117
public
function
getTargetPattern
()
118
{
119
if
(is_null($this->targetPattern)) {
121
$data = $this->
raw
(self::FIELD_TARGET_PATTERN);
122
if
(is_null($data)) {
123
return
null
;
124
}
125
$this->targetPattern = PatternComponentCollection::fromArray($data);
126
}
127
128
return
$this->targetPattern
;
129
}
130
138
public
function
getMaxOccurrence
()
139
{
140
if
(is_null($this->maxOccurrence)) {
142
$data = $this->
raw
(self::FIELD_MAX_OCCURRENCE);
143
if
(is_null($data)) {
144
return
null
;
145
}
146
$this->maxOccurrence = (int) $data;
147
}
148
149
return
$this->maxOccurrence
;
150
}
151
158
public
function
getSelectionMode
()
159
{
160
if
(is_null($this->selectionMode)) {
162
$data = $this->
raw
(self::FIELD_SELECTION_MODE);
163
if
(is_null($data)) {
164
return
null
;
165
}
166
$this->selectionMode = (string) $data;
167
}
168
169
return
$this->selectionMode
;
170
}
171
172
176
public
function
setTriggerPattern
(?
PatternComponentCollection
$triggerPattern
): void
177
{
178
$this->triggerPattern =
$triggerPattern
;
179
}
180
184
public
function
setTargetPattern
(?
PatternComponentCollection
$targetPattern
): void
185
{
186
$this->targetPattern =
$targetPattern
;
187
}
188
192
public
function
setMaxOccurrence
(?
int
$maxOccurrence
): void
193
{
194
$this->maxOccurrence =
$maxOccurrence
;
195
}
196
200
public
function
setSelectionMode
(?
string
$selectionMode
): void
201
{
202
$this->selectionMode =
$selectionMode
;
203
}
204
205
206
207
}
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\CartDiscount\PatternComponentCollection
Definition
PatternComponentCollection.php:22
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel
Definition
ChangeTargetPatternChangeValueModel.php:22
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\getMaxOccurrence
getMaxOccurrence()
Definition
ChangeTargetPatternChangeValueModel.php:138
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\setTargetPattern
setTargetPattern(?PatternComponentCollection $targetPattern)
Definition
ChangeTargetPatternChangeValueModel.php:184
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\setTriggerPattern
setTriggerPattern(?PatternComponentCollection $triggerPattern)
Definition
ChangeTargetPatternChangeValueModel.php:176
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\$selectionMode
$selectionMode
Definition
ChangeTargetPatternChangeValueModel.php:53
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\$type
$type
Definition
ChangeTargetPatternChangeValueModel.php:29
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\$maxOccurrence
$maxOccurrence
Definition
ChangeTargetPatternChangeValueModel.php:47
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\getTriggerPattern
getTriggerPattern()
Definition
ChangeTargetPatternChangeValueModel.php:97
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\setMaxOccurrence
setMaxOccurrence(?int $maxOccurrence)
Definition
ChangeTargetPatternChangeValueModel.php:192
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\setSelectionMode
setSelectionMode(?string $selectionMode)
Definition
ChangeTargetPatternChangeValueModel.php:200
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
ChangeTargetPatternChangeValueModel.php:24
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\getType
getType()
Definition
ChangeTargetPatternChangeValueModel.php:77
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\$targetPattern
$targetPattern
Definition
ChangeTargetPatternChangeValueModel.php:41
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\getTargetPattern
getTargetPattern()
Definition
ChangeTargetPatternChangeValueModel.php:117
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\$triggerPattern
$triggerPattern
Definition
ChangeTargetPatternChangeValueModel.php:35
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\getSelectionMode
getSelectionMode()
Definition
ChangeTargetPatternChangeValueModel.php:158
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValueModel\__construct
__construct(?PatternComponentCollection $triggerPattern=null, ?PatternComponentCollection $targetPattern=null, ?int $maxOccurrence=null, ?string $selectionMode=null, ?string $type=null)
Definition
ChangeTargetPatternChangeValueModel.php:59
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\History\Models\ChangeValue\ChangeTargetPatternChangeValue
Definition
ChangeTargetPatternChangeValue.php:16
Commercetools\History\Models\ChangeValue
Definition
AssetChangeValue.php:9
Generated by
1.9.8