commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ModifiedByBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
19 
23 final class ModifiedByBuilder implements Builder
24 {
29  private $isPlatformClient;
30 
35  private $id;
36 
41  private $type;
42 
47  private $clientId;
48 
53  private $anonymousId;
54 
59  private $customer;
60 
65  private $associate;
66 
73  public function getIsPlatformClient()
74  {
75  return $this->isPlatformClient;
76  }
77 
85  public function getId()
86  {
87  return $this->id;
88  }
89 
101  public function getType()
102  {
103  return $this->type;
104  }
105 
113  public function getClientId()
114  {
115  return $this->clientId;
116  }
117 
124  public function getAnonymousId()
125  {
126  return $this->anonymousId;
127  }
128 
136  public function getCustomer()
137  {
138  return $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer;
139  }
140 
147  public function getAssociate()
148  {
149  return $this->associate instanceof ReferenceBuilder ? $this->associate->build() : $this->associate;
150  }
151 
156  public function withIsPlatformClient(?bool $isPlatformClient)
157  {
158  $this->isPlatformClient = $isPlatformClient;
159 
160  return $this;
161  }
162 
167  public function withId(?string $id)
168  {
169  $this->id = $id;
170 
171  return $this;
172  }
173 
178  public function withType(?string $type)
179  {
180  $this->type = $type;
181 
182  return $this;
183  }
184 
189  public function withClientId(?string $clientId)
190  {
191  $this->clientId = $clientId;
192 
193  return $this;
194  }
195 
200  public function withAnonymousId(?string $anonymousId)
201  {
202  $this->anonymousId = $anonymousId;
203 
204  return $this;
205  }
206 
211  public function withCustomer(?Reference $customer)
212  {
213  $this->customer = $customer;
214 
215  return $this;
216  }
217 
222  public function withAssociate(?Reference $associate)
223  {
224  $this->associate = $associate;
225 
226  return $this;
227  }
228 
233  public function withCustomerBuilder(?ReferenceBuilder $customer)
234  {
235  $this->customer = $customer;
236 
237  return $this;
238  }
239 
244  public function withAssociateBuilder(?ReferenceBuilder $associate)
245  {
246  $this->associate = $associate;
247 
248  return $this;
249  }
250 
251  public function build(): ModifiedBy
252  {
253  return new ModifiedByModel(
254  $this->isPlatformClient,
255  $this->id,
256  $this->type,
257  $this->clientId,
258  $this->anonymousId,
259  $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer,
260  $this->associate instanceof ReferenceBuilder ? $this->associate->build() : $this->associate
261  );
262  }
263 
264  public static function of(): ModifiedByBuilder
265  {
266  return new self();
267  }
268 }