commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
RecurrencePolicyDraftBuilder.php
1<?php
2
3declare(strict_types=1);
10
18use stdClass;
19
24{
29 private $key;
30
35 private $name;
36
41 private $description;
42
47 private $schedule;
48
55 public function getKey()
56 {
57 return $this->key;
58 }
59
66 public function getName()
67 {
68 return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name;
69 }
70
77 public function getDescription()
78 {
79 return $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description;
80 }
81
88 public function getSchedule()
89 {
90 return $this->schedule instanceof RecurrencePolicyScheduleDraftBuilder ? $this->schedule->build() : $this->schedule;
91 }
92
97 public function withKey(?string $key)
98 {
99 $this->key = $key;
100
101 return $this;
102 }
103
108 public function withName(?LocalizedString $name)
109 {
110 $this->name = $name;
111
112 return $this;
113 }
114
119 public function withDescription(?LocalizedString $description)
120 {
121 $this->description = $description;
122
123 return $this;
124 }
125
130 public function withSchedule(?RecurrencePolicyScheduleDraft $schedule)
131 {
132 $this->schedule = $schedule;
133
134 return $this;
135 }
136
142 {
143 $this->name = $name;
144
145 return $this;
146 }
147
152 public function withDescriptionBuilder(?LocalizedStringBuilder $description)
153 {
154 $this->description = $description;
155
156 return $this;
157 }
158
164 {
165 $this->schedule = $schedule;
166
167 return $this;
168 }
169
170 public function build(): RecurrencePolicyDraft
171 {
173 $this->key,
174 $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name,
175 $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description,
176 $this->schedule instanceof RecurrencePolicyScheduleDraftBuilder ? $this->schedule->build() : $this->schedule
177 );
178 }
179
180 public static function of(): RecurrencePolicyDraftBuilder
181 {
182 return new self();
183 }
184}