commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ChangeTargetPatternChangeValueModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
17
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(
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
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
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
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
170 }
171
172
177 {
178 $this->triggerPattern = $triggerPattern;
179 }
180
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}
__construct(?PatternComponentCollection $triggerPattern=null, ?PatternComponentCollection $targetPattern=null, ?int $maxOccurrence=null, ?string $selectionMode=null, ?string $type=null)