-
Notifications
You must be signed in to change notification settings - Fork 2
/
addListProps.php
41 lines (41 loc) · 1.27 KB
/
addListProps.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
<?php
class AddProps extends AbstractMigration
{
public function up()
{
\Bitrix\Main\Loader::includeModule('lists');
$iblockId = 94;
$obList = new CList( $iblockId );
$arFields = $obList->GetFields();
$allListsFields = [
[
"SORT" => 400,
"NAME" => "Дата создания элемента",
"IS_REQUIRED" => "N",
"MULTIPLE" => "N",
"CODE" => "CREATED_AT",
"TYPE" => "S:DateTime",
"DEFAULT_VALUE" => "",
"USER_TYPE_SETTINGS" => "",
"SETTINGS" => [
"SHOW_ADD_FORM" => "Y",
"SHOW_EDIT_FORM" => "Y",
"ADD_READ_ONLY_FIELD" => "N",
"EDIT_READ_ONLY_FIELD" => "N",
"SHOW_FIELD_PREVIEW" => "N",
],
"LIST" =>[],
],
];
foreach ($allListsFields as $allListsField)
{
$obList->AddField($allListsField);
}
global $CACHE_MANAGER;
$CACHE_MANAGER->ClearByTag("lists_list_".$iblockId);
}
public function down()
{
//
}
}