commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
QuoteLabelBuilder.php
1<?php
2
3declare(strict_types=1);
10
16use stdClass;
19
23final class QuoteLabelBuilder implements Builder
24{
29 private $key;
30
35 private $customer;
36
41 private $stagedQuote;
42
47 private $quoteRequest;
48
55 public function getKey()
56 {
57 return $this->key;
58 }
59
66 public function getCustomer()
67 {
68 return $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer;
69 }
70
77 public function getStagedQuote()
78 {
79 return $this->stagedQuote instanceof ReferenceBuilder ? $this->stagedQuote->build() : $this->stagedQuote;
80 }
81
88 public function getQuoteRequest()
89 {
90 return $this->quoteRequest instanceof ReferenceBuilder ? $this->quoteRequest->build() : $this->quoteRequest;
91 }
92
97 public function withKey(?string $key)
98 {
99 $this->key = $key;
100
101 return $this;
102 }
103
108 public function withCustomer(?Reference $customer)
109 {
110 $this->customer = $customer;
111
112 return $this;
113 }
114
119 public function withStagedQuote(?Reference $stagedQuote)
120 {
121 $this->stagedQuote = $stagedQuote;
122
123 return $this;
124 }
125
130 public function withQuoteRequest(?Reference $quoteRequest)
131 {
132 $this->quoteRequest = $quoteRequest;
133
134 return $this;
135 }
136
141 public function withCustomerBuilder(?ReferenceBuilder $customer)
142 {
143 $this->customer = $customer;
144
145 return $this;
146 }
147
152 public function withStagedQuoteBuilder(?ReferenceBuilder $stagedQuote)
153 {
154 $this->stagedQuote = $stagedQuote;
155
156 return $this;
157 }
158
163 public function withQuoteRequestBuilder(?ReferenceBuilder $quoteRequest)
164 {
165 $this->quoteRequest = $quoteRequest;
166
167 return $this;
168 }
169
170 public function build(): QuoteLabel
171 {
172 return new QuoteLabelModel(
173 $this->key,
174 $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer,
175 $this->stagedQuote instanceof ReferenceBuilder ? $this->stagedQuote->build() : $this->stagedQuote,
176 $this->quoteRequest instanceof ReferenceBuilder ? $this->quoteRequest->build() : $this->quoteRequest
177 );
178 }
179
180 public static function of(): QuoteLabelBuilder
181 {
182 return new self();
183 }
184}