commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
DiscountedLineItemPriceDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
23 {
28  protected $value;
29 
34  protected $includedDiscounts;
35 
36 
40  public function __construct(
41  ?Money $value = null,
43  ) {
44  $this->value = $value;
45  $this->includedDiscounts = $includedDiscounts;
46  }
47 
52  public function getValue()
53  {
54  if (is_null($this->value)) {
56  $data = $this->raw(self::FIELD_VALUE);
57  if (is_null($data)) {
58  return null;
59  }
60 
61  $this->value = MoneyModel::of($data);
62  }
63 
64  return $this->value;
65  }
66 
71  public function getIncludedDiscounts()
72  {
73  if (is_null($this->includedDiscounts)) {
75  $data = $this->raw(self::FIELD_INCLUDED_DISCOUNTS);
76  if (is_null($data)) {
77  return null;
78  }
79  $this->includedDiscounts = DiscountedLineItemPortionCollection::fromArray($data);
80  }
81 
83  }
84 
85 
89  public function setValue(?Money $value): void
90  {
91  $this->value = $value;
92  }
93 
98  {
99  $this->includedDiscounts = $includedDiscounts;
100  }
101 }
__construct(?Money $value=null, ?DiscountedLineItemPortionCollection $includedDiscounts=null)
setIncludedDiscounts(?DiscountedLineItemPortionCollection $includedDiscounts)