commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
PriceTierDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
17 
21 final class PriceTierDraftBuilder implements Builder
22 {
27  private $minimumQuantity;
28 
33  private $value;
34 
44  public function getMinimumQuantity()
45  {
46  return $this->minimumQuantity;
47  }
48 
56  public function getValue()
57  {
58  return $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value;
59  }
60 
65  public function withMinimumQuantity(?int $minimumQuantity)
66  {
67  $this->minimumQuantity = $minimumQuantity;
68 
69  return $this;
70  }
71 
76  public function withValue(?Money $value)
77  {
78  $this->value = $value;
79 
80  return $this;
81  }
82 
87  public function withValueBuilder(?MoneyBuilder $value)
88  {
89  $this->value = $value;
90 
91  return $this;
92  }
93 
94  public function build(): PriceTierDraft
95  {
96  return new PriceTierDraftModel(
97  $this->minimumQuantity,
98  $this->value instanceof MoneyBuilder ? $this->value->build() : $this->value
99  );
100  }
101 
102  public static function of(): PriceTierDraftBuilder
103  {
104  return new self();
105  }
106 }