3 declare(strict_types=1);
33 private static $discriminatorClasses = [
34 'addAddress' => BusinessUnitAddAddressActionModel::class,
35 'addAssociate' => BusinessUnitAddAssociateActionModel::class,
36 'addBillingAddressId' => BusinessUnitAddBillingAddressIdActionModel::class,
37 'addShippingAddressId' => BusinessUnitAddShippingAddressIdActionModel::class,
38 'addStore' => BusinessUnitAddStoreActionModel::class,
39 'changeAddress' => BusinessUnitChangeAddressActionModel::class,
40 'changeApprovalRuleMode' => BusinessUnitChangeApprovalRuleModeActionModel::class,
41 'changeAssociate' => BusinessUnitChangeAssociateActionModel::class,
42 'changeAssociateMode' => BusinessUnitChangeAssociateModeActionModel::class,
43 'changeName' => BusinessUnitChangeNameActionModel::class,
44 'changeParentUnit' => BusinessUnitChangeParentUnitActionModel::class,
45 'changeStatus' => BusinessUnitChangeStatusActionModel::class,
46 'removeAddress' => BusinessUnitRemoveAddressActionModel::class,
47 'removeAssociate' => BusinessUnitRemoveAssociateActionModel::class,
48 'removeBillingAddressId' => BusinessUnitRemoveBillingAddressIdActionModel::class,
49 'removeShippingAddressId' => BusinessUnitRemoveShippingAddressIdActionModel::class,
50 'removeStore' => BusinessUnitRemoveStoreActionModel::class,
51 'setAddressCustomField' => BusinessUnitSetAddressCustomFieldActionModel::class,
52 'setAddressCustomType' => BusinessUnitSetAddressCustomTypeActionModel::class,
53 'setAssociates' => BusinessUnitSetAssociatesActionModel::class,
54 'setContactEmail' => BusinessUnitSetContactEmailActionModel::class,
55 'setCustomField' => BusinessUnitSetCustomFieldActionModel::class,
56 'setCustomType' => BusinessUnitSetCustomTypeActionModel::class,
57 'setDefaultBillingAddress' => BusinessUnitSetDefaultBillingAddressActionModel::class,
58 'setDefaultShippingAddress' => BusinessUnitSetDefaultShippingAddressActionModel::class,
59 'setStoreMode' => BusinessUnitSetStoreModeActionModel::class,
60 'setStores' => BusinessUnitSetStoresActionModel::class,
78 if (is_null($this->action)) {
80 $data = $this->
raw(self::FIELD_ACTION);
84 $this->action = (string) $data;
101 if (is_object($value) && isset($value->$fieldName)) {
103 $discriminatorValue = $value->$fieldName;
104 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
105 return self::$discriminatorClasses[$discriminatorValue];
108 if (is_array($value) && isset($value[$fieldName])) {
110 $discriminatorValue = $value[$fieldName];
111 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
112 return self::$discriminatorClasses[$discriminatorValue];
117 $type = BusinessUnitUpdateActionModel::class;