commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
ExtensionDraftModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
21{
26 protected $key;
27
32 protected $destination;
33
38 protected $triggers;
39
44 protected $timeoutInMs;
45
50 protected $dependencies;
51
56 protected $expansionPaths;
57
63
64
68 public function __construct(
69 ?string $key = null,
72 ?int $timeoutInMs = null,
74 ?array $expansionPaths = null,
76 ) {
77 $this->key = $key;
78 $this->destination = $destination;
79 $this->triggers = $triggers;
80 $this->timeoutInMs = $timeoutInMs;
81 $this->dependencies = $dependencies;
82 $this->expansionPaths = $expansionPaths;
83 $this->additionalContext = $additionalContext;
84 }
85
92 public function getKey()
93 {
94 if (is_null($this->key)) {
96 $data = $this->raw(self::FIELD_KEY);
97 if (is_null($data)) {
98 return null;
99 }
100 $this->key = (string) $data;
101 }
102
103 return $this->key;
104 }
105
112 public function getDestination()
113 {
114 if (is_null($this->destination)) {
116 $data = $this->raw(self::FIELD_DESTINATION);
117 if (is_null($data)) {
118 return null;
119 }
121 $this->destination = $className::of($data);
122 }
123
124 return $this->destination;
125 }
126
133 public function getTriggers()
134 {
135 if (is_null($this->triggers)) {
137 $data = $this->raw(self::FIELD_TRIGGERS);
138 if (is_null($data)) {
139 return null;
140 }
141 $this->triggers = ExtensionTriggerCollection::fromArray($data);
142 }
143
144 return $this->triggers;
145 }
146
157 public function getTimeoutInMs()
158 {
159 if (is_null($this->timeoutInMs)) {
161 $data = $this->raw(self::FIELD_TIMEOUT_IN_MS);
162 if (is_null($data)) {
163 return null;
164 }
165 $this->timeoutInMs = (int) $data;
166 }
167
168 return $this->timeoutInMs;
169 }
170
177 public function getDependencies()
178 {
179 if (is_null($this->dependencies)) {
181 $data = $this->raw(self::FIELD_DEPENDENCIES);
182 if (is_null($data)) {
183 return null;
184 }
185 $this->dependencies = ExtensionResourceIdentifierCollection::fromArray($data);
186 }
187
188 return $this->dependencies;
189 }
190
198 public function getExpansionPaths()
199 {
200 if (is_null($this->expansionPaths)) {
202 $data = $this->raw(self::FIELD_EXPANSION_PATHS);
203 if (is_null($data)) {
204 return null;
205 }
206 $this->expansionPaths = $data;
207 }
208
210 }
211
218 public function getAdditionalContext()
219 {
220 if (is_null($this->additionalContext)) {
222 $data = $this->raw(self::FIELD_ADDITIONAL_CONTEXT);
223 if (is_null($data)) {
224 return null;
225 }
226
227 $this->additionalContext = ExtensionAdditionalContextDraftModel::of($data);
228 }
229
231 }
232
233
237 public function setKey(?string $key): void
238 {
239 $this->key = $key;
240 }
241
246 {
247 $this->destination = $destination;
248 }
249
254 {
255 $this->triggers = $triggers;
256 }
257
261 public function setTimeoutInMs(?int $timeoutInMs): void
262 {
263 $this->timeoutInMs = $timeoutInMs;
264 }
265
270 {
271 $this->dependencies = $dependencies;
272 }
273
277 public function setExpansionPaths(?array $expansionPaths): void
278 {
279 $this->expansionPaths = $expansionPaths;
280 }
281
286 {
287 $this->additionalContext = $additionalContext;
288 }
289}
setAdditionalContext(?ExtensionAdditionalContextDraft $additionalContext)
setDependencies(?ExtensionResourceIdentifierCollection $dependencies)
__construct(?string $key=null, ?ExtensionDestination $destination=null, ?ExtensionTriggerCollection $triggers=null, ?int $timeoutInMs=null, ?ExtensionResourceIdentifierCollection $dependencies=null, ?array $expansionPaths=null, ?ExtensionAdditionalContextDraft $additionalContext=null)
static fromArray(array $data)