3 declare(strict_types=1);
33 private static $discriminatorClasses = [
34 'addPermission' => AssociateRoleAddPermissionActionModel::class,
35 'changeBuyerAssignable' => AssociateRoleChangeBuyerAssignableActionModel::class,
36 'removePermission' => AssociateRoleRemovePermissionActionModel::class,
37 'setCustomField' => AssociateRoleSetCustomFieldActionModel::class,
38 'setCustomType' => AssociateRoleSetCustomTypeActionModel::class,
39 'setName' => AssociateRoleSetNameActionModel::class,
40 'setPermissions' => AssociateRoleSetPermissionsActionModel::class,
58 if (is_null($this->action)) {
60 $data = $this->
raw(self::FIELD_ACTION);
64 $this->action = (string) $data;
81 if (is_object($value) && isset($value->$fieldName)) {
83 $discriminatorValue = $value->$fieldName;
84 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
85 return self::$discriminatorClasses[$discriminatorValue];
88 if (is_array($value) && isset($value[$fieldName])) {
90 $discriminatorValue = $value[$fieldName];
91 if (isset(self::$discriminatorClasses[$discriminatorValue])) {
92 return self::$discriminatorClasses[$discriminatorValue];
97 $type = AssociateRoleUpdateActionModel::class;