commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CustomLineItemTaxedPriceModel.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 ?TypedMoney $totalNet = null,
43 ) {
44 $this->totalNet = $totalNet;
45 $this->totalGross = $totalGross;
46 }
47
52 public function getTotalNet()
53 {
54 if (is_null($this->totalNet)) {
56 $data = $this->raw(self::FIELD_TOTAL_NET);
57 if (is_null($data)) {
58 return null;
59 }
60 $className = TypedMoneyModel::resolveDiscriminatorClass($data);
61 $this->totalNet = $className::of($data);
62 }
63
64 return $this->totalNet;
65 }
66
71 public function getTotalGross()
72 {
73 if (is_null($this->totalGross)) {
75 $data = $this->raw(self::FIELD_TOTAL_GROSS);
76 if (is_null($data)) {
77 return null;
78 }
79 $className = TypedMoneyModel::resolveDiscriminatorClass($data);
80 $this->totalGross = $className::of($data);
81 }
82
83 return $this->totalGross;
84 }
85
86
90 public function setTotalNet(?TypedMoney $totalNet): void
91 {
92 $this->totalNet = $totalNet;
93 }
94
98 public function setTotalGross(?TypedMoney $totalGross): void
99 {
100 $this->totalGross = $totalGross;
101 }
102}
__construct(?TypedMoney $totalNet=null, ?TypedMoney $totalGross=null)