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
OrderEdit
OrderEditDraftModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\OrderEdit
;
10
11
use
Commercetools\Api\Models\Order\OrderReference
;
12
use
Commercetools\Api\Models\Order\OrderReferenceModel
;
13
use
Commercetools\Api\Models\Order\StagedOrderUpdateActionCollection
;
14
use
Commercetools\Api\Models\Type\CustomFieldsDraft
;
15
use
Commercetools\Api\Models\Type\CustomFieldsDraftModel
;
16
use
Commercetools\Base\DateTimeImmutableCollection
;
17
use
Commercetools\Base\JsonObject
;
18
use
Commercetools\Base\JsonObjectModel
;
19
use
Commercetools\Base\MapperFactory
;
20
use stdClass;
21
25
final
class
OrderEditDraftModel
extends
JsonObjectModel
implements
OrderEditDraft
26
{
31
protected
$key
;
32
37
protected
$resource
;
38
43
protected
$stagedActions
;
44
49
protected
$custom
;
50
55
protected
$comment
;
56
61
protected
$dryRun
;
62
63
67
public
function
__construct
(
68
?
string
$key
=
null
,
69
?
OrderReference
$resource
=
null
,
70
?
StagedOrderUpdateActionCollection
$stagedActions
=
null
,
71
?
CustomFieldsDraft
$custom
=
null
,
72
?
string
$comment
=
null
,
73
?
bool
$dryRun
=
null
74
) {
75
$this->key =
$key
;
76
$this->resource =
$resource
;
77
$this->stagedActions =
$stagedActions
;
78
$this->custom =
$custom
;
79
$this->comment =
$comment
;
80
$this->dryRun =
$dryRun
;
81
}
82
89
public
function
getKey
()
90
{
91
if
(is_null($this->key)) {
93
$data = $this->
raw
(self::FIELD_KEY);
94
if
(is_null($data)) {
95
return
null
;
96
}
97
$this->key = (string) $data;
98
}
99
100
return
$this->key
;
101
}
102
109
public
function
getResource
()
110
{
111
if
(is_null($this->resource)) {
113
$data = $this->
raw
(self::FIELD_RESOURCE);
114
if
(is_null($data)) {
115
return
null
;
116
}
117
118
$this->resource = OrderReferenceModel::of($data);
119
}
120
121
return
$this->resource
;
122
}
123
131
public
function
getStagedActions
()
132
{
133
if
(is_null($this->stagedActions)) {
135
$data = $this->
raw
(self::FIELD_STAGED_ACTIONS);
136
if
(is_null($data)) {
137
return
null
;
138
}
139
$this->stagedActions = StagedOrderUpdateActionCollection::fromArray($data);
140
}
141
142
return
$this->stagedActions
;
143
}
144
151
public
function
getCustom
()
152
{
153
if
(is_null($this->custom)) {
155
$data = $this->
raw
(self::FIELD_CUSTOM);
156
if
(is_null($data)) {
157
return
null
;
158
}
159
160
$this->custom = CustomFieldsDraftModel::of($data);
161
}
162
163
return
$this->custom
;
164
}
165
172
public
function
getComment
()
173
{
174
if
(is_null($this->comment)) {
176
$data = $this->
raw
(self::FIELD_COMMENT);
177
if
(is_null($data)) {
178
return
null
;
179
}
180
$this->comment = (string) $data;
181
}
182
183
return
$this->comment
;
184
}
185
194
public
function
getDryRun
()
195
{
196
if
(is_null($this->dryRun)) {
198
$data = $this->
raw
(self::FIELD_DRY_RUN);
199
if
(is_null($data)) {
200
return
null
;
201
}
202
$this->dryRun = (bool) $data;
203
}
204
205
return
$this->dryRun
;
206
}
207
208
212
public
function
setKey
(?
string
$key
): void
213
{
214
$this->key =
$key
;
215
}
216
220
public
function
setResource
(?
OrderReference
$resource
): void
221
{
222
$this->resource =
$resource
;
223
}
224
228
public
function
setStagedActions
(?
StagedOrderUpdateActionCollection
$stagedActions
): void
229
{
230
$this->stagedActions =
$stagedActions
;
231
}
232
236
public
function
setCustom
(?
CustomFieldsDraft
$custom
): void
237
{
238
$this->custom =
$custom
;
239
}
240
244
public
function
setComment
(?
string
$comment
): void
245
{
246
$this->comment =
$comment
;
247
}
248
252
public
function
setDryRun
(?
bool
$dryRun
): void
253
{
254
$this->dryRun =
$dryRun
;
255
}
256
}
Commercetools\Api\Models\Order\OrderReferenceModel
Definition
OrderReferenceModel.php:23
Commercetools\Api\Models\Order\StagedOrderUpdateActionCollection
Definition
StagedOrderUpdateActionCollection.php:26
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel
Definition
OrderEditDraftModel.php:26
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\$resource
$resource
Definition
OrderEditDraftModel.php:37
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\setCustom
setCustom(?CustomFieldsDraft $custom)
Definition
OrderEditDraftModel.php:236
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\setDryRun
setDryRun(?bool $dryRun)
Definition
OrderEditDraftModel.php:252
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\getStagedActions
getStagedActions()
Definition
OrderEditDraftModel.php:131
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\getResource
getResource()
Definition
OrderEditDraftModel.php:109
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\getCustom
getCustom()
Definition
OrderEditDraftModel.php:151
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\setResource
setResource(?OrderReference $resource)
Definition
OrderEditDraftModel.php:220
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\getDryRun
getDryRun()
Definition
OrderEditDraftModel.php:194
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\setStagedActions
setStagedActions(?StagedOrderUpdateActionCollection $stagedActions)
Definition
OrderEditDraftModel.php:228
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\getComment
getComment()
Definition
OrderEditDraftModel.php:172
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\$dryRun
$dryRun
Definition
OrderEditDraftModel.php:61
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\setKey
setKey(?string $key)
Definition
OrderEditDraftModel.php:212
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\$key
$key
Definition
OrderEditDraftModel.php:31
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\getKey
getKey()
Definition
OrderEditDraftModel.php:89
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\$custom
$custom
Definition
OrderEditDraftModel.php:49
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\__construct
__construct(?string $key=null, ?OrderReference $resource=null, ?StagedOrderUpdateActionCollection $stagedActions=null, ?CustomFieldsDraft $custom=null, ?string $comment=null, ?bool $dryRun=null)
Definition
OrderEditDraftModel.php:67
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\$stagedActions
$stagedActions
Definition
OrderEditDraftModel.php:43
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\setComment
setComment(?string $comment)
Definition
OrderEditDraftModel.php:244
Commercetools\Api\Models\OrderEdit\OrderEditDraftModel\$comment
$comment
Definition
OrderEditDraftModel.php:55
Commercetools\Api\Models\Type\CustomFieldsDraftModel
Definition
CustomFieldsDraftModel.php:21
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\Order\OrderReference
Definition
OrderReference.php:16
Commercetools\Api\Models\OrderEdit\OrderEditDraft
Definition
OrderEditDraft.php:18
Commercetools\Api\Models\Type\CustomFieldsDraft
Definition
CustomFieldsDraft.php:15
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\OrderEdit
Definition
OrderEdit.php:9
Generated by
1.9.8