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
Extension
ExtensionDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Extension
;
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
ExtensionDraftModel
extends
JsonObjectModel
implements
ExtensionDraft
21
{
26
protected
$key
;
27
32
protected
$destination
;
33
38
protected
$triggers
;
39
44
protected
$timeoutInMs
;
45
46
50
public
function
__construct
(
51
?
string
$key
=
null
,
52
?
ExtensionDestination
$destination
=
null
,
53
?
ExtensionTriggerCollection
$triggers
=
null
,
54
?
int
$timeoutInMs
=
null
55
) {
56
$this->key =
$key
;
57
$this->destination =
$destination
;
58
$this->triggers =
$triggers
;
59
$this->timeoutInMs =
$timeoutInMs
;
60
}
61
68
public
function
getKey
()
69
{
70
if
(is_null($this->key)) {
72
$data = $this->
raw
(self::FIELD_KEY);
73
if
(is_null($data)) {
74
return
null
;
75
}
76
$this->key = (string) $data;
77
}
78
79
return
$this->key
;
80
}
81
88
public
function
getDestination
()
89
{
90
if
(is_null($this->destination)) {
92
$data = $this->
raw
(self::FIELD_DESTINATION);
93
if
(is_null($data)) {
94
return
null
;
95
}
96
$className =
ExtensionDestinationModel::resolveDiscriminatorClass
($data);
97
$this->destination = $className::of($data);
98
}
99
100
return
$this->destination
;
101
}
102
109
public
function
getTriggers
()
110
{
111
if
(is_null($this->triggers)) {
113
$data = $this->
raw
(self::FIELD_TRIGGERS);
114
if
(is_null($data)) {
115
return
null
;
116
}
117
$this->triggers =
ExtensionTriggerCollection::fromArray
($data);
118
}
119
120
return
$this->triggers
;
121
}
122
133
public
function
getTimeoutInMs
()
134
{
135
if
(is_null($this->timeoutInMs)) {
137
$data = $this->
raw
(self::FIELD_TIMEOUT_IN_MS);
138
if
(is_null($data)) {
139
return
null
;
140
}
141
$this->timeoutInMs = (int) $data;
142
}
143
144
return
$this->timeoutInMs
;
145
}
146
147
151
public
function
setKey
(?
string
$key
): void
152
{
153
$this->key =
$key
;
154
}
155
159
public
function
setDestination
(?
ExtensionDestination
$destination
): void
160
{
161
$this->destination =
$destination
;
162
}
163
167
public
function
setTriggers
(?
ExtensionTriggerCollection
$triggers
): void
168
{
169
$this->triggers =
$triggers
;
170
}
171
175
public
function
setTimeoutInMs
(?
int
$timeoutInMs
): void
176
{
177
$this->timeoutInMs =
$timeoutInMs
;
178
}
179
}
Commercetools\Api\Models\Extension\ExtensionDestinationModel\resolveDiscriminatorClass
static resolveDiscriminatorClass($value)
Definition
ExtensionDestinationModel.php:74
Commercetools\Api\Models\Extension\ExtensionDraftModel
Definition
ExtensionDraftModel.php:21
Commercetools\Api\Models\Extension\ExtensionDraftModel\$triggers
$triggers
Definition
ExtensionDraftModel.php:38
Commercetools\Api\Models\Extension\ExtensionDraftModel\getDestination
getDestination()
Definition
ExtensionDraftModel.php:88
Commercetools\Api\Models\Extension\ExtensionDraftModel\getTimeoutInMs
getTimeoutInMs()
Definition
ExtensionDraftModel.php:133
Commercetools\Api\Models\Extension\ExtensionDraftModel\$key
$key
Definition
ExtensionDraftModel.php:26
Commercetools\Api\Models\Extension\ExtensionDraftModel\getKey
getKey()
Definition
ExtensionDraftModel.php:68
Commercetools\Api\Models\Extension\ExtensionDraftModel\setKey
setKey(?string $key)
Definition
ExtensionDraftModel.php:151
Commercetools\Api\Models\Extension\ExtensionDraftModel\__construct
__construct(?string $key=null, ?ExtensionDestination $destination=null, ?ExtensionTriggerCollection $triggers=null, ?int $timeoutInMs=null)
Definition
ExtensionDraftModel.php:50
Commercetools\Api\Models\Extension\ExtensionDraftModel\$destination
$destination
Definition
ExtensionDraftModel.php:32
Commercetools\Api\Models\Extension\ExtensionDraftModel\setDestination
setDestination(?ExtensionDestination $destination)
Definition
ExtensionDraftModel.php:159
Commercetools\Api\Models\Extension\ExtensionDraftModel\setTimeoutInMs
setTimeoutInMs(?int $timeoutInMs)
Definition
ExtensionDraftModel.php:175
Commercetools\Api\Models\Extension\ExtensionDraftModel\getTriggers
getTriggers()
Definition
ExtensionDraftModel.php:109
Commercetools\Api\Models\Extension\ExtensionDraftModel\setTriggers
setTriggers(?ExtensionTriggerCollection $triggers)
Definition
ExtensionDraftModel.php:167
Commercetools\Api\Models\Extension\ExtensionDraftModel\$timeoutInMs
$timeoutInMs
Definition
ExtensionDraftModel.php:44
Commercetools\Api\Models\Extension\ExtensionTriggerCollection
Definition
ExtensionTriggerCollection.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\Extension\ExtensionDestination
Definition
ExtensionDestination.php:15
Commercetools\Api\Models\Extension\ExtensionDraft
Definition
ExtensionDraft.php:15
Commercetools\Base\CSequence\fromArray
static fromArray(array $data)
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Extension
Definition
AuthorizationHeaderAuthentication.php:9
Generated by
1.9.8