commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
EventBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use DateTimeImmutable;
17use stdClass;
18
22final class EventBuilder implements Builder
23{
28 private $id;
29
34 private $notificationType;
35
40 private $resourceType;
41
46 private $createdAt;
47
54 public function getId()
55 {
56 return $this->id;
57 }
58
63 public function getNotificationType()
64 {
65 return $this->notificationType;
66 }
67
74 public function getResourceType()
75 {
76 return $this->resourceType;
77 }
78
85 public function getCreatedAt()
86 {
87 return $this->createdAt;
88 }
89
94 public function withId(?string $id)
95 {
96 $this->id = $id;
97
98 return $this;
99 }
100
105 public function withNotificationType(?string $notificationType)
106 {
107 $this->notificationType = $notificationType;
108
109 return $this;
110 }
111
116 public function withResourceType(?string $resourceType)
117 {
118 $this->resourceType = $resourceType;
119
120 return $this;
121 }
122
127 public function withCreatedAt(?DateTimeImmutable $createdAt)
128 {
129 $this->createdAt = $createdAt;
130
131 return $this;
132 }
133
134
135 public function build(): Event
136 {
137 return new EventModel(
138 $this->id,
139 $this->notificationType,
140 $this->resourceType,
141 $this->createdAt
142 );
143 }
144
145 public static function of(): EventBuilder
146 {
147 return new self();
148 }
149}
withNotificationType(?string $notificationType)
withCreatedAt(?DateTimeImmutable $createdAt)