commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
TaxedItemPriceDraftBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
23 final class TaxedItemPriceDraftBuilder implements Builder
24 {
29  private $totalNet;
30 
35  private $totalGross;
36 
43  public function getTotalNet()
44  {
45  return $this->totalNet instanceof MoneyBuilder ? $this->totalNet->build() : $this->totalNet;
46  }
47 
54  public function getTotalGross()
55  {
56  return $this->totalGross instanceof MoneyBuilder ? $this->totalGross->build() : $this->totalGross;
57  }
58 
63  public function withTotalNet(?Money $totalNet)
64  {
65  $this->totalNet = $totalNet;
66 
67  return $this;
68  }
69 
74  public function withTotalGross(?Money $totalGross)
75  {
76  $this->totalGross = $totalGross;
77 
78  return $this;
79  }
80 
85  public function withTotalNetBuilder(?MoneyBuilder $totalNet)
86  {
87  $this->totalNet = $totalNet;
88 
89  return $this;
90  }
91 
96  public function withTotalGrossBuilder(?MoneyBuilder $totalGross)
97  {
98  $this->totalGross = $totalGross;
99 
100  return $this;
101  }
102 
103  public function build(): TaxedItemPriceDraft
104  {
105  return new TaxedItemPriceDraftModel(
106  $this->totalNet instanceof MoneyBuilder ? $this->totalNet->build() : $this->totalNet,
107  $this->totalGross instanceof MoneyBuilder ? $this->totalGross->build() : $this->totalGross
108  );
109  }
110 
111  public static function of(): TaxedItemPriceDraftBuilder
112  {
113  return new self();
114  }
115 }