commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
CartClassificationTierBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
23 final class CartClassificationTierBuilder implements Builder
24 {
29  private $value;
30 
35  private $price;
36 
41  private $tiers;
42 
47  private $isMatching;
48 
53  public function getValue()
54  {
55  return $this->value;
56  }
57 
62  public function getPrice()
63  {
64  return $this->price instanceof MoneyBuilder ? $this->price->build() : $this->price;
65  }
66 
71  public function getTiers()
72  {
73  return $this->tiers;
74  }
75 
80  public function getIsMatching()
81  {
82  return $this->isMatching;
83  }
84 
89  public function withValue(?string $value)
90  {
91  $this->value = $value;
92 
93  return $this;
94  }
95 
100  public function withPrice(?Money $price)
101  {
102  $this->price = $price;
103 
104  return $this;
105  }
106 
112  {
113  $this->tiers = $tiers;
114 
115  return $this;
116  }
117 
122  public function withIsMatching(?bool $isMatching)
123  {
124  $this->isMatching = $isMatching;
125 
126  return $this;
127  }
128 
133  public function withPriceBuilder(?MoneyBuilder $price)
134  {
135  $this->price = $price;
136 
137  return $this;
138  }
139 
140  public function build(): CartClassificationTier
141  {
142  return new CartClassificationTierModel(
143  $this->value,
144  $this->price instanceof MoneyBuilder ? $this->price->build() : $this->price,
145  $this->tiers,
146  $this->isMatching
147  );
148  }
149 
150  public static function of(): CartClassificationTierBuilder
151  {
152  return new self();
153  }
154 }