commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
OrderLabelModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
20 final class OrderLabelModel extends JsonObjectModel implements OrderLabel
21 {
22 
23  public const DISCRIMINATOR_VALUE = 'OrderLabel';
28  protected $type;
29 
34  protected $customerEmail;
35 
40  protected $orderNumber;
41 
42 
46  public function __construct(
47  ?string $customerEmail = null,
48  ?string $orderNumber = null,
49  ?string $type = null
50  ) {
51  $this->customerEmail = $customerEmail;
52  $this->orderNumber = $orderNumber;
53  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
54  }
55 
60  public function getType()
61  {
62  if (is_null($this->type)) {
64  $data = $this->raw(self::FIELD_TYPE);
65  if (is_null($data)) {
66  return null;
67  }
68  $this->type = (string) $data;
69  }
70 
71  return $this->type;
72  }
73 
80  public function getCustomerEmail()
81  {
82  if (is_null($this->customerEmail)) {
84  $data = $this->raw(self::FIELD_CUSTOMER_EMAIL);
85  if (is_null($data)) {
86  return null;
87  }
88  $this->customerEmail = (string) $data;
89  }
90 
91  return $this->customerEmail;
92  }
93 
100  public function getOrderNumber()
101  {
102  if (is_null($this->orderNumber)) {
104  $data = $this->raw(self::FIELD_ORDER_NUMBER);
105  if (is_null($data)) {
106  return null;
107  }
108  $this->orderNumber = (string) $data;
109  }
110 
111  return $this->orderNumber;
112  }
113 
114 
118  public function setCustomerEmail(?string $customerEmail): void
119  {
120  $this->customerEmail = $customerEmail;
121  }
122 
126  public function setOrderNumber(?string $orderNumber): void
127  {
128  $this->orderNumber = $orderNumber;
129  }
130 
131 
132 
133 }
__construct(?string $customerEmail=null, ?string $orderNumber=null, ?string $type=null)