commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
CustomLineItemTaxedPriceBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
24 {
29  private $totalNet;
30 
35  private $totalGross;
36 
41  public function getTotalNet()
42  {
43  return $this->totalNet instanceof TypedMoneyBuilder ? $this->totalNet->build() : $this->totalNet;
44  }
45 
50  public function getTotalGross()
51  {
52  return $this->totalGross instanceof TypedMoneyBuilder ? $this->totalGross->build() : $this->totalGross;
53  }
54 
59  public function withTotalNet(?TypedMoney $totalNet)
60  {
61  $this->totalNet = $totalNet;
62 
63  return $this;
64  }
65 
70  public function withTotalGross(?TypedMoney $totalGross)
71  {
72  $this->totalGross = $totalGross;
73 
74  return $this;
75  }
76 
81  public function withTotalNetBuilder(?TypedMoneyBuilder $totalNet)
82  {
83  $this->totalNet = $totalNet;
84 
85  return $this;
86  }
87 
92  public function withTotalGrossBuilder(?TypedMoneyBuilder $totalGross)
93  {
94  $this->totalGross = $totalGross;
95 
96  return $this;
97  }
98 
99  public function build(): CustomLineItemTaxedPrice
100  {
102  $this->totalNet instanceof TypedMoneyBuilder ? $this->totalNet->build() : $this->totalNet,
103  $this->totalGross instanceof TypedMoneyBuilder ? $this->totalGross->build() : $this->totalGross
104  );
105  }
106 
107  public static function of(): CustomLineItemTaxedPriceBuilder
108  {
109  return new self();
110  }
111 }