1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
userconsentitem.php
См. документацию.
1
<?php
8
namespace
Bitrix\Main\UserConsent\Internals;
9
10
use Bitrix\Main\Localization\Loc;
11
use Bitrix\Main\ORM\Fields\Relations\Reference;
12
use Bitrix\Main\ORM\Query\Join;
13
use Bitrix\Main\ORM\Data\DataManager;
14
15
Loc::loadMessages(__FILE__);
16
33
class
UserConsentItemTable
extends
DataManager
34
{
40
public
static
function
getTableName
()
41
{
42
return
'b_consent_user_consent_item'
;
43
}
44
53
public
static
function
getMap
()
54
{
55
return
[
56
'ID'
=> [
57
'data_type'
=>
'integer'
,
58
'primary'
=>
true
,
59
'autocomplete'
=>
true
,
60
],
61
'USER_CONSENT_ID'
=> [
62
'data_type'
=>
'integer'
,
63
'required'
=>
true
,
64
],
65
'VALUE'
=> [
66
'data_type'
=>
'text'
,
67
'required'
=>
true
,
68
],
69
(
new
Reference
(
70
'USER_CONSENT'
,
71
ConsentTable::class,
72
Join::on(
'this.USER_CONSENT_ID'
,
'ref.ID'
)
73
))
74
];
75
}
76
84
public
static
function
addItems
(
int
$userConsentId,
array
$items
): void
85
{
86
foreach
(
$items
as $item)
87
{
88
static::add([
89
'USER_CONSENT_ID'
=> $userConsentId,
90
'VALUE'
=> $item[
'VALUE'
],
91
]);
92
}
93
}
94
105
public
static
function
getItems
(
int
$userConsentId):
array
106
{
107
$items
= [];
108
109
$queryObject = static::getList([
110
'filter'
=> [
111
'=USER_CONSENT_ID'
=> $userConsentId
112
]
113
]);
114
while
($item = $queryObject->fetch())
115
{
116
$items
[] = $item;
117
}
118
119
return
$items
;
120
}
121
130
public
static
function
removeItems
(
int
$userConsentId): void
131
{
132
$queryObject = static::getList([
133
'select'
=> [
'ID'
],
134
'filter'
=> [
135
'=USER_CONSENT_ID'
=> $userConsentId
136
]
137
]);
138
while
($item = $queryObject->fetch())
139
{
140
static::delete($item[
'ID'
]);
141
}
142
}
143
}
Bitrix\Main\ORM\Data\DataManager
Определения
datamanager.php:35
Bitrix\Main\ORM\Fields\Relations\Reference
Определения
reference.php:26
Bitrix\Main\UserConsent\Internals\UserConsentItemTable
Определения
userconsentitem.php:34
Bitrix\Main\UserConsent\Internals\UserConsentItemTable\getMap
static getMap()
Определения
userconsentitem.php:53
Bitrix\Main\UserConsent\Internals\UserConsentItemTable\addItems
static addItems(int $userConsentId, array $items)
Определения
userconsentitem.php:84
Bitrix\Main\UserConsent\Internals\UserConsentItemTable\getItems
static getItems(int $userConsentId)
Определения
userconsentitem.php:105
Bitrix\Main\UserConsent\Internals\UserConsentItemTable\removeItems
static removeItems(int $userConsentId)
Определения
userconsentitem.php:130
Bitrix\Main\UserConsent\Internals\UserConsentItemTable\getTableName
static getTableName()
Определения
userconsentitem.php:40
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$items
$items
Определения
template.php:224
bitrix
modules
main
lib
userconsent
internals
userconsentitem.php
Создано системой
1.14.0