34 public static function getMap(): array
38 'data_type' =>
'string',
40 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_ID_TITLE'),
43 'data_type' =>
'string',
44 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_NAME_TITLE'),
47 'data_type' =>
'string',
48 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_DESCRIPTION_TITLE'),
51 'data_type' =>
'string',
52 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_PROPERTY_TYPE_TITLE'),
55 'data_type' =>
'boolean',
56 'values' => [
'N',
'Y'],
57 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_IS_REQUIRED_TITLE'),
60 'data_type' =>
'boolean',
61 'values' => [
'N',
'Y'],
62 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_IS_MULTIPLE_TITLE'),
64 'PROPERTY_OPTIONS' => [
65 'data_type' =>
'string',
67 'validation' => [__CLASS__,
'validateTextField'],
68 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_PROPERTY_OPTIONS_TITLE'),
70 'PROPERTY_SETTINGS' => [
71 'data_type' =>
'string',
73 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_PROPERTY_SETTINGS_TITLE'),
76 'data_type' =>
'string',
78 'validation' => [__CLASS__,
'validateTextField'],
79 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_PROPERTY_VALUE_TITLE'),
82 'data_type' =>
'datetime',
83 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_CREATED_DATE_TITLE'),
86 'data_type' =>
'integer',
87 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_CREATED_BY_TITLE'),
90 'data_type' =>
'string',
91 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_VISIBILITY_TITLE'),
94 'data_type' =>
'datetime',
95 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_MODIFIED_DATE_TITLE'),
98 'data_type' =>
'integer',
99 'title' => Main\Localization\Loc::getMessage(
'BIZPROC_WF_TYPE_GLOBALS_MANAGER_COLUMN_MODIFIED_BY_TITLE'),
124 public static function upsertByProperty(
string $varId, array $property,
int $userId =
null)
126 $property = static::normalizePropertyForUpsert($property, $userId);
130 'NAME' => trim($property[
'Name']),
131 'DESCRIPTION' => $property[
'Description'],
132 'PROPERTY_TYPE' => $property[
'Type'],
133 'IS_REQUIRED' => $property[
'Required'] ?
'Y' :
'N',
134 'IS_MULTIPLE' => $property[
'Multiple'] ?
'Y' :
'N',
135 'PROPERTY_OPTIONS' => $property[
'Options'],
136 'PROPERTY_VALUE' => $property[
'Default'],
137 'VISIBILITY' => $property[
'Visibility'],
138 'CREATED_BY' => $property[
'CreatedBy'],
139 'CREATED_DATE' => $property[
'CreatedDate'],
140 'MODIFIED_DATE' => $property[
'ModifiedDate'],
141 'MODIFIED_BY' => $property[
'ModifiedBy'],
144 if ($userId ===
null)
146 unset($fields[
'CREATED_BY'], $fields[
'CREATED_DATE'], $fields[
'MODIFIED_BY'], $fields[
'MODIFIED_DATE']);
149 $oldProperty = static::getByPrimary($varId)->fetch();
152 if (isset($oldProperty[
'CREATED_BY']))
154 unset($fields[
'CREATED_BY'], $fields[
'CREATED_DATE']);
157 $result = static::update($varId, $fields);
161 $fields[
'ID'] = $varId;
162 $result = static::add($fields);