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
Agent
AgentResponsesCartSuccessModel.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\Agent
;
10
11
use
Commercetools\Api\Models\Cart\Cart
;
12
use
Commercetools\Api\Models\Cart\CartModel
;
13
use
Commercetools\Api\Models\Warning\WarningObjectCollection
;
14
use
Commercetools\Base\DateTimeImmutableCollection
;
15
use
Commercetools\Base\JsonObject
;
16
use
Commercetools\Base\JsonObjectModel
;
17
use
Commercetools\Base\MapperFactory
;
18
use stdClass;
19
23
final
class
AgentResponsesCartSuccessModel
extends
JsonObjectModel
implements
AgentResponsesCartSuccess
24
{
25
public
const
DISCRIMINATOR_VALUE
=
'Cart'
;
30
protected
$entityType
;
31
36
protected
$warnings
;
37
42
protected
$threadId
;
43
48
protected
$entity
;
49
50
54
public
function
__construct
(
55
?
WarningObjectCollection
$warnings
=
null
,
56
?
string
$threadId
=
null
,
57
?
Cart
$entity
=
null
,
58
?
string
$entityType
=
null
59
) {
60
$this->warnings =
$warnings
;
61
$this->threadId =
$threadId
;
62
$this->entity =
$entity
;
63
$this->entityType =
$entityType
??
self::DISCRIMINATOR_VALUE
;
64
}
65
72
public
function
getEntityType
()
73
{
74
if
(is_null($this->entityType)) {
76
$data = $this->
raw
(self::FIELD_ENTITY_TYPE);
77
if
(is_null($data)) {
78
return
null
;
79
}
80
$this->entityType = (string) $data;
81
}
82
83
return
$this->entityType
;
84
}
85
92
public
function
getWarnings
()
93
{
94
if
(is_null($this->warnings)) {
96
$data = $this->
raw
(self::FIELD_WARNINGS);
97
if
(is_null($data)) {
98
return
null
;
99
}
100
$this->warnings = WarningObjectCollection::fromArray($data);
101
}
102
103
return
$this->warnings
;
104
}
105
112
public
function
getThreadId
()
113
{
114
if
(is_null($this->threadId)) {
116
$data = $this->
raw
(self::FIELD_THREAD_ID);
117
if
(is_null($data)) {
118
return
null
;
119
}
120
$this->threadId = (string) $data;
121
}
122
123
return
$this->threadId
;
124
}
125
132
public
function
getEntity
()
133
{
134
if
(is_null($this->entity)) {
136
$data = $this->
raw
(self::FIELD_ENTITY);
137
if
(is_null($data)) {
138
return
null
;
139
}
140
141
$this->entity = CartModel::of($data);
142
}
143
144
return
$this->entity
;
145
}
146
147
151
public
function
setWarnings
(?
WarningObjectCollection
$warnings
): void
152
{
153
$this->warnings =
$warnings
;
154
}
155
159
public
function
setThreadId
(?
string
$threadId
): void
160
{
161
$this->threadId =
$threadId
;
162
}
163
167
public
function
setEntity
(?
Cart
$entity
): void
168
{
169
$this->entity =
$entity
;
170
}
171
}
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel
Definition
AgentResponsesCartSuccessModel.php:24
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\getThreadId
getThreadId()
Definition
AgentResponsesCartSuccessModel.php:112
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\getEntityType
getEntityType()
Definition
AgentResponsesCartSuccessModel.php:72
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\DISCRIMINATOR_VALUE
const DISCRIMINATOR_VALUE
Definition
AgentResponsesCartSuccessModel.php:25
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\getEntity
getEntity()
Definition
AgentResponsesCartSuccessModel.php:132
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\$threadId
$threadId
Definition
AgentResponsesCartSuccessModel.php:42
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\setWarnings
setWarnings(?WarningObjectCollection $warnings)
Definition
AgentResponsesCartSuccessModel.php:151
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\setEntity
setEntity(?Cart $entity)
Definition
AgentResponsesCartSuccessModel.php:167
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\setThreadId
setThreadId(?string $threadId)
Definition
AgentResponsesCartSuccessModel.php:159
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\getWarnings
getWarnings()
Definition
AgentResponsesCartSuccessModel.php:92
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\$entityType
$entityType
Definition
AgentResponsesCartSuccessModel.php:30
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\$entity
$entity
Definition
AgentResponsesCartSuccessModel.php:48
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\__construct
__construct(?WarningObjectCollection $warnings=null, ?string $threadId=null, ?Cart $entity=null, ?string $entityType=null)
Definition
AgentResponsesCartSuccessModel.php:54
Commercetools\Api\Models\Agent\AgentResponsesCartSuccessModel\$warnings
$warnings
Definition
AgentResponsesCartSuccessModel.php:36
Commercetools\Api\Models\Cart\CartModel
Definition
CartModel.php:45
Commercetools\Api\Models\Warning\WarningObjectCollection
Definition
WarningObjectCollection.php:26
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\Agent\AgentResponsesCartSuccess
Definition
AgentResponsesCartSuccess.php:16
Commercetools\Api\Models\Cart\Cart
Definition
Cart.php:29
Commercetools\Base\JsonObject
Definition
JsonObject.php:15
Commercetools\Api\Models\Agent
Definition
AgentBusinessUnitAmbiguousError.php:9
Generated by
1.9.8