commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
EventSubscriptionBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
17
21final class EventSubscriptionBuilder implements Builder
22{
27 private $resourceTypeId;
28
33 private $types;
34
41 public function getResourceTypeId()
42 {
43 return $this->resourceTypeId;
44 }
45
54 public function getTypes()
55 {
56 return $this->types;
57 }
58
63 public function withResourceTypeId(?string $resourceTypeId)
64 {
65 $this->resourceTypeId = $resourceTypeId;
66
67 return $this;
68 }
69
74 public function withTypes(?array $types)
75 {
76 $this->types = $types;
77
78 return $this;
79 }
80
81
82 public function build(): EventSubscription
83 {
84 return new EventSubscriptionModel(
85 $this->resourceTypeId,
86 $this->types
87 );
88 }
89
90 public static function of(): EventSubscriptionBuilder
91 {
92 return new self();
93 }
94}