Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
templatetable.php
1
<?php
8
namespace
Bitrix\Main\Sms
;
9
10
use
Bitrix\Main\ORM
;
11
use
Bitrix\Main\ORM\Data
;
12
use
Bitrix\Main\ORM\Fields
;
13
use
Bitrix\Main\Localization\Loc
;
14
31
class
TemplateTable
extends
Data\DataManager
32
{
33
public
static
function
getTableName
()
34
{
35
return
'b_sms_template'
;
36
}
37
38
public
static
function
getObjectClass
()
39
{
40
return
Template::class;
41
}
42
43
public
static
function
getMap
()
44
{
45
return
array(
46
(
new
Fields\
IntegerField
(
"ID"
))
47
->configurePrimary(
true
)
48
->configureAutocomplete(
true
)
49
->configureTitle(
Loc::getMessage
(
"sms_template_id_title"
)),
50
51
(
new
Fields\
StringField
(
"EVENT_NAME"
))
52
->configureRequired(
true
)
53
->configureTitle(
Loc::getMessage
(
"sms_template_event_name_title"
)),
54
55
(
new
Fields\
BooleanField
(
"ACTIVE"
))
56
->configureStorageValues(
"N"
,
"Y"
)
57
->configureDefaultValue(
"Y"
)
58
->configureTitle(
Loc::getMessage
(
"sms_template_active_title"
)),
59
60
(
new
Fields\
StringField
(
"SENDER"
))
61
->configureRequired(
true
)
62
->configureTitle(
Loc::getMessage
(
"sms_template_sender_title"
)),
63
64
(
new
Fields\
StringField
(
"RECEIVER"
))
65
->configureRequired(
true
)
66
->configureTitle(
Loc::getMessage
(
"sms_template_receiver_title"
)),
67
68
(
new
Fields\
TextField
(
"MESSAGE"
))
69
->configureTitle(
Loc::getMessage
(
"sms_template_message_title"
)),
70
71
(
new
Fields\
StringField
(
"LANGUAGE_ID"
))
72
->configureTitle(
Loc::getMessage
(
"sms_template_language_title"
)),
73
74
(
new
Fields\Relations\
ManyToMany
(
'SITES'
, \
Bitrix
\Main\SiteTable::class))
75
->configureMediatorTableName(
'b_sms_template_site'
)
76
->configureRemotePrimary(
'LID'
,
'SITE_ID'
)
77
);
78
}
79
80
public
static
function
onDelete
(ORM\
Event
$event)
81
{
82
$primary = $event->getParameter(
"id"
);
83
84
$template = static::getEntity()->wakeUpObject($primary[
"ID"
]);
85
$template->removeAllSites();
86
$template->save();
87
}
88
}
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Fields\BooleanField
Definition
booleanfield.php:20
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\Relations\ManyToMany
Definition
manytomany.php:26
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\ORM\Fields\TextField
Definition
textfield.php:20
Bitrix\Main\Sms\TemplateTable
Definition
templatetable.php:32
Bitrix\Main\Sms\TemplateTable\onDelete
static onDelete(ORM\Event $event)
Definition
templatetable.php:80
Bitrix\Main\Sms\TemplateTable\getMap
static getMap()
Definition
templatetable.php:43
Bitrix\Main\Sms\TemplateTable\getObjectClass
static getObjectClass()
Definition
templatetable.php:38
Bitrix\Main\Sms\TemplateTable\getTableName
static getTableName()
Definition
templatetable.php:33
Bitrix\Main\ORM\Data
Definition
addresult.php:9
Bitrix\Main\ORM\Fields
Definition
arrayfield.php:9
Bitrix\Main\ORM
Bitrix\Main\Sms
Definition
event.php:8
Bitrix
modules
main
lib
sms
templatetable.php
Создано системой
1.10.0