forked from VitaliiSestrenskyi/bitrix24_migrations
-
Notifications
You must be signed in to change notification settings - Fork 1
/
addUfFieldDouble.php
61 lines (61 loc) · 1.65 KB
/
addUfFieldDouble.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
class CreateUfTestDealField extends AbstractMigration
{
private $arFields = [
'ENTITY_ID' => 'CRM_DEAL',
'FIELD_NAME' => 'UF_TEST_DEAL',
'USER_TYPE_ID' => 'double',
'XML_ID' => 'UF_TEST_DEAL',
'SORT' => '100',
'MULTIPLE' => null,
'MANDATORY' => null,
'SHOW_FILTER' => 'N',
'SHOW_IN_LIST' => null,
'EDIT_IN_LIST' => null,
'IS_SEARCHABLE' => null,
'SETTINGS' => array(
'PRECISION'=>4,
'DEFAULT_VALUE' => '',
'SIZE' => '20',
'MIN_VALUE'=>0,
'MAX_VALUE'=>0
),
'EDIT_FORM_LABEL' => array(
'ru' => 'Тест',
'en' => 'UF_TEST_DEAL',
),
'LIST_COLUMN_LABEL' => array(
'ru' => 'Тест',
'en' => 'UF_TEST_DEAL',
),
'LIST_FILTER_LABEL' => array(
'ru' => 'Тест',
'en' => 'UF_TEST_DEAL',
),
'ERROR_MESSAGE' => array(
'ru' => 'Тест',
'en' => '',
),
'HELP_MESSAGE' => array(
'ru' => 'Тест',
'en' => 'UF_TEST_DEAL',
),
];
public function up()
{
$obUserField = new CUserTypeEntity;
$obUserField->Add($this->arFields);
}
public function down()
{
$rsData = CUserTypeEntity::GetList(
array($by => $order),
array('FIELD_NAME' => $this->arFields['FIELD_NAME'])
);
if ($arRes = $rsData->Fetch())
{
$obCUserTypeEntity = new CUserTypeEntity;
$obCUserTypeEntity->Delete($arRes['ID']);
}
}
}