commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
BaseEventBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use DateTimeImmutable;
17use stdClass;
18
22final class BaseEventBuilder implements Builder
23{
28 private $id;
29
34 private $notificationType;
35
40 private $resourceType;
41
46 private $type;
47
52 private $data;
53
58 private $createdAt;
59
66 public function getId()
67 {
68 return $this->id;
69 }
70
75 public function getNotificationType()
76 {
77 return $this->notificationType;
78 }
79
86 public function getResourceType()
87 {
88 return $this->resourceType;
89 }
90
97 public function getType()
98 {
99 return $this->type;
100 }
101
108 public function getData()
109 {
110 return $this->data;
111 }
112
119 public function getCreatedAt()
120 {
121 return $this->createdAt;
122 }
123
128 public function withId(?string $id)
129 {
130 $this->id = $id;
131
132 return $this;
133 }
134
139 public function withNotificationType(?string $notificationType)
140 {
141 $this->notificationType = $notificationType;
142
143 return $this;
144 }
145
150 public function withResourceType(?string $resourceType)
151 {
152 $this->resourceType = $resourceType;
153
154 return $this;
155 }
156
161 public function withType(?string $type)
162 {
163 $this->type = $type;
164
165 return $this;
166 }
167
172 public function withData(?JsonObject $data)
173 {
174 $this->data = $data;
175
176 return $this;
177 }
178
183 public function withCreatedAt(?DateTimeImmutable $createdAt)
184 {
185 $this->createdAt = $createdAt;
186
187 return $this;
188 }
189
190
191 public function build(): BaseEvent
192 {
193 return new BaseEventModel(
194 $this->id,
195 $this->notificationType,
196 $this->resourceType,
197 $this->type,
198 $this->data,
199 $this->createdAt
200 );
201 }
202
203 public static function of(): BaseEventBuilder
204 {
205 return new self();
206 }
207}