3 declare(strict_types=1);
90 private static $discriminatorClasses = [
91 'Company' => MyCompanyDraftModel::class,
92 'Division' => MyDivisionDraftModel::class,
100 ?
string $name =
null,
130 if (is_null($this->key)) {
132 $data = $this->
raw(self::FIELD_KEY);
133 if (is_null($data)) {
136 $this->key = (string) $data;
150 if (is_null($this->unitType)) {
152 $data = $this->
raw(self::FIELD_UNIT_TYPE);
153 if (is_null($data)) {
156 $this->unitType = (string) $data;
170 if (is_null($this->name)) {
172 $data = $this->
raw(self::FIELD_NAME);
173 if (is_null($data)) {
176 $this->name = (string) $data;
190 if (is_null($this->contactEmail)) {
192 $data = $this->
raw(self::FIELD_CONTACT_EMAIL);
193 if (is_null($data)) {
196 $this->contactEmail = (string) $data;
210 if (is_null($this->custom)) {
212 $data = $this->
raw(self::FIELD_CUSTOM);
213 if (is_null($data)) {
231 if (is_null($this->addresses)) {
233 $data = $this->
raw(self::FIELD_ADDRESSES);
234 if (is_null($data)) {
252 if (is_null($this->shippingAddresses)) {
254 $data = $this->
raw(self::FIELD_SHIPPING_ADDRESSES);
255 if (is_null($data)) {
258 $this->shippingAddresses = $data;
272 if (is_null($this->defaultShippingAddress)) {
274 $data = $this->
raw(self::FIELD_DEFAULT_SHIPPING_ADDRESS);
275 if (is_null($data)) {
278 $this->defaultShippingAddress = (int) $data;
293 if (is_null($this->billingAddresses)) {
295 $data = $this->
raw(self::FIELD_BILLING_ADDRESSES);
296 if (is_null($data)) {
299 $this->billingAddresses = $data;
313 if (is_null($this->defaultBillingAddress)) {
315 $data = $this->
raw(self::FIELD_DEFAULT_BILLING_ADDRESS);
316 if (is_null($data)) {
319 $this->defaultBillingAddress = (int) $data;
407 if (is_object($value) && isset($value->$fieldName)) {
409 $discriminatorValue = $value->$fieldName;
410 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
411 return self::$discriminatorClasses[$discriminatorValue];
414 if (is_array($value) && isset($value[$fieldName])) {
416 $discriminatorValue = $value[$fieldName];
417 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
418 return self::$discriminatorClasses[$discriminatorValue];
423 $type = MyBusinessUnitDraftModel::class;