commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
AgentResponsesCartSuccessModel.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
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(
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
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}
__construct(?WarningObjectCollection $warnings=null, ?string $threadId=null, ?Cart $entity=null, ?string $entityType=null)