commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
QuoteLabelModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
18 
22 final class QuoteLabelModel extends JsonObjectModel implements QuoteLabel
23 {
24 
25  public const DISCRIMINATOR_VALUE = 'QuoteLabel';
30  protected $type;
31 
36  protected $key;
37 
42  protected $customer;
43 
48  protected $stagedQuote;
49 
54  protected $quoteRequest;
55 
56 
60  public function __construct(
61  ?string $key = null,
62  ?Reference $customer = null,
63  ?Reference $stagedQuote = null,
64  ?Reference $quoteRequest = null,
65  ?string $type = null
66  ) {
67  $this->key = $key;
68  $this->customer = $customer;
69  $this->stagedQuote = $stagedQuote;
70  $this->quoteRequest = $quoteRequest;
71  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
72  }
73 
78  public function getType()
79  {
80  if (is_null($this->type)) {
82  $data = $this->raw(self::FIELD_TYPE);
83  if (is_null($data)) {
84  return null;
85  }
86  $this->type = (string) $data;
87  }
88 
89  return $this->type;
90  }
91 
98  public function getKey()
99  {
100  if (is_null($this->key)) {
102  $data = $this->raw(self::FIELD_KEY);
103  if (is_null($data)) {
104  return null;
105  }
106  $this->key = (string) $data;
107  }
108 
109  return $this->key;
110  }
111 
118  public function getCustomer()
119  {
120  if (is_null($this->customer)) {
122  $data = $this->raw(self::FIELD_CUSTOMER);
123  if (is_null($data)) {
124  return null;
125  }
126 
127  $this->customer = ReferenceModel::of($data);
128  }
129 
130  return $this->customer;
131  }
132 
139  public function getStagedQuote()
140  {
141  if (is_null($this->stagedQuote)) {
143  $data = $this->raw(self::FIELD_STAGED_QUOTE);
144  if (is_null($data)) {
145  return null;
146  }
147 
148  $this->stagedQuote = ReferenceModel::of($data);
149  }
150 
151  return $this->stagedQuote;
152  }
153 
160  public function getQuoteRequest()
161  {
162  if (is_null($this->quoteRequest)) {
164  $data = $this->raw(self::FIELD_QUOTE_REQUEST);
165  if (is_null($data)) {
166  return null;
167  }
168 
169  $this->quoteRequest = ReferenceModel::of($data);
170  }
171 
172  return $this->quoteRequest;
173  }
174 
175 
179  public function setKey(?string $key): void
180  {
181  $this->key = $key;
182  }
183 
187  public function setCustomer(?Reference $customer): void
188  {
189  $this->customer = $customer;
190  }
191 
195  public function setStagedQuote(?Reference $stagedQuote): void
196  {
197  $this->stagedQuote = $stagedQuote;
198  }
199 
203  public function setQuoteRequest(?Reference $quoteRequest): void
204  {
205  $this->quoteRequest = $quoteRequest;
206  }
207 
208 
209 
210 }
__construct(?string $key=null, ?Reference $customer=null, ?Reference $stagedQuote=null, ?Reference $quoteRequest=null, ?string $type=null)