forked from VitaliiSestrenskyi/bitrix24_migrations
-
Notifications
You must be signed in to change notification settings - Fork 1
/
addUfFieldDatetime.php
59 lines (58 loc) · 1.57 KB
/
addUfFieldDatetime.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
<?php
class CreateUfTestDealField extends AbstractMigration
{
private $arFields = [
'ENTITY_ID' => 'CRM_DEAL',
'FIELD_NAME' => 'UF_TEST_DEAL',
'USER_TYPE_ID' => 'datetime',
'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(
'DEFAULT_VALUE' => '',
'USE_SECOND' => 'N',
),
'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']);
}
}
}