-
Notifications
You must be signed in to change notification settings - Fork 2
/
addOrderProp.php
53 lines (46 loc) · 1.2 KB
/
addOrderProp.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
<?php
class CreateOrderProp
{
private $arFields = array(
'PERSON_TYPE_ID' => 1,
'NAME' => 'Количество доступных бонусов',
'TYPE' => 'TEXT',
'REQUIED' => 'N',
'DEFAULT_VALUE' => '0',
'SORT' => 100,
'CODE' => 'AVAILABLE_BONUSES',
'USER_PROPS' => 'N',
'IS_LOCATION' => 'N',
'IS_LOCATION4TAX' => 'N',
'PROPS_GROUP_ID' => 1,
'SIZE1' => 0,
'SIZE2' => 0,
'DESCRIPTION' => '',
'IS_EMAIL' => 'N',
'IS_PROFILE_NAME' => 'N',
'IS_PAYER' => 'N',
'UTIL' => 'Y'
);
public function up()
{
\Bitrix\Main\Loader::includeModule('sale');
CSaleOrderProps::Add($this->arFields);
}
public function down()
{
\Bitrix\Main\Loader::includeModule('sale');
$dbProps = CSaleOrderProps::GetList(
array('SORT' => 'ASC'),
array(
'CODE' => $this->arFields['CODE']
),
false,
false,
array('ID')
);
if ($prop = $dbProps->Fetch())
{
CSaleOrderProps::Delete($prop['ID']);
}
}
}