commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
TaxedItemPriceDraftModel.php
1<?php
2
3declare(strict_types=1);
10
17use stdClass;
18
23{
28 protected $totalNet;
29
34 protected $totalGross;
35
36
40 public function __construct(
41 ?Money $totalNet = null,
42 ?Money $totalGross = null
43 ) {
44 $this->totalNet = $totalNet;
45 $this->totalGross = $totalGross;
46 }
47
54 public function getTotalNet()
55 {
56 if (is_null($this->totalNet)) {
58 $data = $this->raw(self::FIELD_TOTAL_NET);
59 if (is_null($data)) {
60 return null;
61 }
62
63 $this->totalNet = MoneyModel::of($data);
64 }
65
66 return $this->totalNet;
67 }
68
75 public function getTotalGross()
76 {
77 if (is_null($this->totalGross)) {
79 $data = $this->raw(self::FIELD_TOTAL_GROSS);
80 if (is_null($data)) {
81 return null;
82 }
83
84 $this->totalGross = MoneyModel::of($data);
85 }
86
87 return $this->totalGross;
88 }
89
90
94 public function setTotalNet(?Money $totalNet): void
95 {
96 $this->totalNet = $totalNet;
97 }
98
102 public function setTotalGross(?Money $totalGross): void
103 {
104 $this->totalGross = $totalGross;
105 }
106}
__construct(?Money $totalNet=null, ?Money $totalGross=null)