-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaddUfFieldIblockElement.php
56 lines (56 loc) · 1.52 KB
/
addUfFieldIblockElement.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
<?php
class CreateUfTestDealField extends AbstractMigration
{
private $arFields = [
'ENTITY_ID' => 'CRM_DEAL',
'FIELD_NAME' => 'UF_TEST',
'USER_TYPE_ID' => 'iblock_element',
'XML_ID' => 'UF_TEST',
'SORT' => '100',
'MULTIPLE' => null,
'MANDATORY' => null,
'SHOW_FILTER' => 'N',
'SHOW_IN_LIST' => null,
'EDIT_IN_LIST' => null,
'IS_SEARCHABLE' => null,
'SETTINGS' => array (
'DISPLAY' => 'LIST',
'LIST_HEIGHT' => 20,
'IBLOCK_ID' => 81,
'DEFAULT_VALUE' => '',
'ACTIVE_FILTER' => 'N',
),
'EDIT_FORM_LABEL' => array(
'ru' => 'test',
),
'LIST_COLUMN_LABEL' => array(
'ru' => 'test',
),
'LIST_FILTER_LABEL' => array(
'ru' => 'test',
),
'ERROR_MESSAGE' => array(
'ru' => '',
),
'HELP_MESSAGE' => array(
'ru' => 'test',
),
];
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'], 'ENTITY_ID' => $this->arFields['ENTITY_ID'])
);
if ($arRes = $rsData->Fetch())
{
$obCUserTypeEntity = new CUserTypeEntity;
$obCUserTypeEntity->Delete($arRes['ID']);
}
}
}