Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
agreement.php
1
<?php
8
namespace
Bitrix\Main\UserConsent\Internals
;
9
10
use
Bitrix\Main\Application
;
11
use
Bitrix\Main\Entity
;
12
use
Bitrix\Main\Type\DateTime
;
13
use
Bitrix\Main\Localization\Loc
;
14
use
Bitrix\Main\Security\Random
;
15
use
Bitrix\Main\UserConsent\Agreement
;
16
17
Loc::loadMessages
(__FILE__);
18
35
class
AgreementTable
extends
Entity\DataManager
36
{
42
public
static
function
getTableName
()
43
{
44
return
'b_consent_agreement'
;
45
}
46
52
public
static
function
getMap
()
53
{
54
return
array(
55
'ID'
=> array(
56
'data_type'
=>
'integer'
,
57
'primary'
=>
true
,
58
'autocomplete'
=>
true
,
59
),
60
'CODE'
=> array(
61
'data_type'
=>
'string'
,
62
),
63
'DATE_INSERT'
=> array(
64
'data_type'
=>
'datetime'
,
65
'required'
=>
true
,
66
'default_value'
=>
new
DateTime
(),
67
),
68
'ACTIVE'
=> array(
69
'data_type'
=>
'boolean'
,
70
'required'
=>
true
,
71
'default_value'
=>
Agreement::ACTIVE
,
72
'values'
=> array(
Agreement::NOT_ACTIVE
,
Agreement::ACTIVE
)
73
),
74
'NAME'
=> array(
75
'data_type'
=>
'string'
,
76
'required'
=>
true
,
77
'title'
=>
Loc::getMessage
(
'MAIN_USER_CONSENT_TBL_AGREEMENT_FIELD_TITLE_NAME'
),
78
),
79
'TYPE'
=> array(
80
'data_type'
=>
'string'
,
81
'required'
=>
true
,
82
'default_value'
=>
Agreement::TYPE_STANDARD
,
83
'values'
=> array(
Agreement::TYPE_CUSTOM
,
Agreement::TYPE_STANDARD
)
84
),
85
'LANGUAGE_ID'
=> array(
86
'data_type'
=>
'string'
,
87
),
88
'DATA_PROVIDER'
=> array(
89
'data_type'
=>
'string'
,
90
),
91
'AGREEMENT_TEXT'
=> array(
92
'data_type'
=>
'text'
,
93
),
94
'LABEL_TEXT'
=> array(
95
'data_type'
=>
'string'
,
96
),
97
'SECURITY_CODE'
=> array(
98
'data_type'
=>
'string'
,
99
'default_value'
=>
function
()
100
{
101
return
Random::getString(6);
102
}
103
),
104
'USE_URL'
=> [
105
'data_type'
=>
'boolean'
,
106
'default_value'
=>
'N'
,
107
'values'
=> [
'Y'
,
'N'
]
108
],
109
'URL'
=> [
110
'data_type'
=>
'string'
,
111
],
112
'IS_AGREEMENT_TEXT_HTML'
=> [
113
'data_type'
=>
'boolean'
,
114
'default_value'
=>
'N'
,
115
'values'
=> [
'Y'
,
'N'
]
116
],
117
);
118
}
119
126
public
static
function
onAfterDelete
(
Entity
\
Event
$event)
127
{
128
$result =
new
Entity\EventResult;
129
$data = $event->getParameters();
130
131
$sql =
"DELETE FROM "
.
ConsentTable::getTableName
() .
" WHERE AGREEMENT_ID = "
. intval($data[
'primary'
][
'ID'
]);
132
Application::getConnection
()->query($sql);
133
134
return
$result;
135
}
136
}
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Application\getConnection
static getConnection($name="")
Definition
application.php:611
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Main\Security\Random
Definition
random.php:6
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Main\UserConsent\Agreement
Definition
agreement.php:25
Bitrix\Main\UserConsent\Agreement\TYPE_CUSTOM
const TYPE_CUSTOM
Definition
agreement.php:29
Bitrix\Main\UserConsent\Agreement\NOT_ACTIVE
const NOT_ACTIVE
Definition
agreement.php:27
Bitrix\Main\UserConsent\Agreement\TYPE_STANDARD
const TYPE_STANDARD
Definition
agreement.php:28
Bitrix\Main\UserConsent\Agreement\ACTIVE
const ACTIVE
Definition
agreement.php:26
Bitrix\Main\UserConsent\Internals\AgreementTable
Definition
agreement.php:36
Bitrix\Main\UserConsent\Internals\AgreementTable\getMap
static getMap()
Definition
agreement.php:52
Bitrix\Main\UserConsent\Internals\AgreementTable\onAfterDelete
static onAfterDelete(Entity\Event $event)
Definition
agreement.php:126
Bitrix\Main\UserConsent\Internals\AgreementTable\getTableName
static getTableName()
Definition
agreement.php:42
Bitrix\Main\UserConsent\Internals\ConsentTable\getTableName
static getTableName()
Definition
consent.php:41
Bitrix\Main\UserConsent\Internals
Definition
agreement.php:8
modules
main
lib
userconsent
internals
agreement.php
Создано системой
1.10.0