commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
CustomerLabelModel.php
1<?php
2
3declare(strict_types=1);
10
15use stdClass;
16
20final class CustomerLabelModel extends JsonObjectModel implements CustomerLabel
21{
22
23 public const DISCRIMINATOR_VALUE = 'CustomerLabel';
28 protected $type;
29
34 protected $firstName;
35
40 protected $lastName;
41
46 protected $customerNumber;
47
48
52 public function __construct(
53 ?string $firstName = null,
54 ?string $lastName = null,
55 ?string $customerNumber = null,
56 ?string $type = null
57 ) {
58 $this->firstName = $firstName;
59 $this->lastName = $lastName;
60 $this->customerNumber = $customerNumber;
61 $this->type = $type ?? self::DISCRIMINATOR_VALUE;
62 }
63
68 public function getType()
69 {
70 if (is_null($this->type)) {
72 $data = $this->raw(self::FIELD_TYPE);
73 if (is_null($data)) {
74 return null;
75 }
76 $this->type = (string) $data;
77 }
78
79 return $this->type;
80 }
81
88 public function getFirstName()
89 {
90 if (is_null($this->firstName)) {
92 $data = $this->raw(self::FIELD_FIRST_NAME);
93 if (is_null($data)) {
94 return null;
95 }
96 $this->firstName = (string) $data;
97 }
98
99 return $this->firstName;
100 }
101
108 public function getLastName()
109 {
110 if (is_null($this->lastName)) {
112 $data = $this->raw(self::FIELD_LAST_NAME);
113 if (is_null($data)) {
114 return null;
115 }
116 $this->lastName = (string) $data;
117 }
118
119 return $this->lastName;
120 }
121
128 public function getCustomerNumber()
129 {
130 if (is_null($this->customerNumber)) {
132 $data = $this->raw(self::FIELD_CUSTOMER_NUMBER);
133 if (is_null($data)) {
134 return null;
135 }
136 $this->customerNumber = (string) $data;
137 }
138
140 }
141
142
146 public function setFirstName(?string $firstName): void
147 {
148 $this->firstName = $firstName;
149 }
150
154 public function setLastName(?string $lastName): void
155 {
156 $this->lastName = $lastName;
157 }
158
162 public function setCustomerNumber(?string $customerNumber): void
163 {
164 $this->customerNumber = $customerNumber;
165 }
166
167
168
169}
__construct(?string $firstName=null, ?string $lastName=null, ?string $customerNumber=null, ?string $type=null)