3 declare(strict_types=1);
127 private static $discriminatorClasses = [
128 'Company' => CompanyDraftModel::class,
129 'Division' => DivisionDraftModel::class,
140 ?
string $name =
null,
179 if (is_null($this->key)) {
181 $data = $this->
raw(self::FIELD_KEY);
182 if (is_null($data)) {
185 $this->key = (string) $data;
199 if (is_null($this->status)) {
201 $data = $this->
raw(self::FIELD_STATUS);
202 if (is_null($data)) {
205 $this->status = (string) $data;
222 if (is_null($this->stores)) {
224 $data = $this->
raw(self::FIELD_STORES);
225 if (is_null($data)) {
243 if (is_null($this->storeMode)) {
245 $data = $this->
raw(self::FIELD_STORE_MODE);
246 if (is_null($data)) {
249 $this->storeMode = (string) $data;
263 if (is_null($this->unitType)) {
265 $data = $this->
raw(self::FIELD_UNIT_TYPE);
266 if (is_null($data)) {
269 $this->unitType = (string) $data;
283 if (is_null($this->name)) {
285 $data = $this->
raw(self::FIELD_NAME);
286 if (is_null($data)) {
289 $this->name = (string) $data;
303 if (is_null($this->contactEmail)) {
305 $data = $this->
raw(self::FIELD_CONTACT_EMAIL);
306 if (is_null($data)) {
309 $this->contactEmail = (string) $data;
324 if (is_null($this->associateMode)) {
326 $data = $this->
raw(self::FIELD_ASSOCIATE_MODE);
327 if (is_null($data)) {
330 $this->associateMode = (string) $data;
344 if (is_null($this->associates)) {
346 $data = $this->
raw(self::FIELD_ASSOCIATES);
347 if (is_null($data)) {
366 if (is_null($this->approvalRuleMode)) {
368 $data = $this->
raw(self::FIELD_APPROVAL_RULE_MODE);
369 if (is_null($data)) {
372 $this->approvalRuleMode = (string) $data;
386 if (is_null($this->addresses)) {
388 $data = $this->
raw(self::FIELD_ADDRESSES);
389 if (is_null($data)) {
407 if (is_null($this->shippingAddresses)) {
409 $data = $this->
raw(self::FIELD_SHIPPING_ADDRESSES);
410 if (is_null($data)) {
413 $this->shippingAddresses = $data;
427 if (is_null($this->defaultShippingAddress)) {
429 $data = $this->
raw(self::FIELD_DEFAULT_SHIPPING_ADDRESS);
430 if (is_null($data)) {
433 $this->defaultShippingAddress = (int) $data;
448 if (is_null($this->billingAddresses)) {
450 $data = $this->
raw(self::FIELD_BILLING_ADDRESSES);
451 if (is_null($data)) {
454 $this->billingAddresses = $data;
468 if (is_null($this->defaultBillingAddress)) {
470 $data = $this->
raw(self::FIELD_DEFAULT_BILLING_ADDRESS);
471 if (is_null($data)) {
474 $this->defaultBillingAddress = (int) $data;
488 if (is_null($this->custom)) {
490 $data = $this->
raw(self::FIELD_CUSTOM);
491 if (is_null($data)) {
631 if (is_object($value) && isset($value->$fieldName)) {
633 $discriminatorValue = $value->$fieldName;
634 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
635 return self::$discriminatorClasses[$discriminatorValue];
638 if (is_array($value) && isset($value[$fieldName])) {
640 $discriminatorValue = $value[$fieldName];
641 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
642 return self::$discriminatorClasses[$discriminatorValue];
647 $type = BusinessUnitDraftModel::class;