commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
SubRateBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
21 final class SubRateBuilder implements Builder
22 {
27  private $name;
28 
33  private $amount;
34 
39  public function getName()
40  {
41  return $this->name;
42  }
43 
48  public function getAmount()
49  {
50  return $this->amount;
51  }
52 
57  public function withName(?string $name)
58  {
59  $this->name = $name;
60 
61  return $this;
62  }
63 
68  public function withAmount(?float $amount)
69  {
70  $this->amount = $amount;
71 
72  return $this;
73  }
74 
75 
76  public function build(): SubRate
77  {
78  return new SubRateModel(
79  $this->name,
80  $this->amount
81  );
82  }
83 
84  public static function of(): SubRateBuilder
85  {
86  return new self();
87  }
88 }