1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
field.php
См. документацию.
1
<?php
8
namespace
Bitrix\Main\UserConsent\Internals;
9
10
use Bitrix\Main\Localization\Loc;
11
use Bitrix\Main\ORM\Data\DataManager;
12
13
Loc::loadMessages(__FILE__);
14
31
class
FieldTable
extends
DataManager
32
{
38
public
static
function
getTableName
()
39
{
40
return
'b_consent_field'
;
41
}
42
48
public
static
function
getMap
()
49
{
50
return
array
(
51
'ID'
=>
array
(
52
'data_type'
=>
'integer'
,
53
'primary'
=>
true
,
54
'autocomplete'
=>
true
,
55
),
56
'AGREEMENT_ID'
=>
array
(
57
'data_type'
=>
'integer'
,
58
'required'
=>
true
,
59
),
60
'CODE'
=>
array
(
61
'data_type'
=>
'string'
,
62
'required'
=>
true
,
63
),
64
'VALUE'
=>
array
(
65
'data_type'
=>
'text'
,
66
'required'
=>
true
,
67
)
68
);
69
}
70
77
public
static
function
getConsentFields
($agreementId)
78
{
79
$fields
=
array
();
80
$fieldsDb = static::getList(
array
(
81
'filter'
=>
array
(
82
'=AGREEMENT_ID'
=> $agreementId
83
)
84
));
85
while
($field = $fieldsDb->fetch())
86
{
87
$fields
[$field[
'CODE'
]] = $field[
'VALUE'
];
88
}
89
90
return
$fields
;
91
}
92
100
public
static
function
setConsentFields
($agreementId,
array
$fields
)
101
{
102
// remove old fields
103
$deleteFieldsDb = static::getList(
array
(
104
'select'
=>
array
(
'ID'
),
105
'filter'
=>
array
(
106
'=AGREEMENT_ID'
=> $agreementId
107
)
108
));
109
while
($deleteField = $deleteFieldsDb->fetch())
110
{
111
static::delete($deleteField[
'ID'
]);
112
}
113
114
// add new fields
115
foreach
(
$fields
as
$code
=> $value)
116
{
117
$result
= static::add(
array
(
118
'AGREEMENT_ID'
=> $agreementId,
119
'CODE'
=>
$code
,
120
'VALUE'
=> $value,
121
));
122
$result
->isSuccess();
123
}
124
}
125
}
Bitrix\Main\ORM\Data\DataManager
Определения
datamanager.php:35
Bitrix\Main\UserConsent\Internals\FieldTable
Определения
field.php:32
Bitrix\Main\UserConsent\Internals\FieldTable\getMap
static getMap()
Определения
field.php:48
Bitrix\Main\UserConsent\Internals\FieldTable\getConsentFields
static getConsentFields($agreementId)
Определения
field.php:77
Bitrix\Main\UserConsent\Internals\FieldTable\setConsentFields
static setConsentFields($agreementId, array $fields)
Определения
field.php:100
Bitrix\Main\UserConsent\Internals\FieldTable\getTableName
static getTableName()
Определения
field.php:38
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
$code
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения
options.php:195
$fields
$fields
Определения
yandex_run.php:501
bitrix
modules
main
lib
userconsent
internals
field.php
Создано системой
1.14.0