commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
PriceTierDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class PriceTierDraftModel extends JsonObjectModel implements PriceTierDraft
21 {
26  protected $minimumQuantity;
27 
32  protected $value;
33 
34 
38  public function __construct(
39  ?int $minimumQuantity = null,
40  ?Money $value = null
41  ) {
42  $this->minimumQuantity = $minimumQuantity;
43  $this->value = $value;
44  }
45 
55  public function getMinimumQuantity()
56  {
57  if (is_null($this->minimumQuantity)) {
59  $data = $this->raw(self::FIELD_MINIMUM_QUANTITY);
60  if (is_null($data)) {
61  return null;
62  }
63  $this->minimumQuantity = (int) $data;
64  }
65 
67  }
68 
76  public function getValue()
77  {
78  if (is_null($this->value)) {
80  $data = $this->raw(self::FIELD_VALUE);
81  if (is_null($data)) {
82  return null;
83  }
84 
85  $this->value = MoneyModel::of($data);
86  }
87 
88  return $this->value;
89  }
90 
91 
95  public function setMinimumQuantity(?int $minimumQuantity): void
96  {
97  $this->minimumQuantity = $minimumQuantity;
98  }
99 
103  public function setValue(?Money $value): void
104  {
105  $this->value = $value;
106  }
107 }
__construct(?int $minimumQuantity=null, ?Money $value=null)