Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
templatetable.php
1<?php
8namespace Bitrix\Main\Sms;
9
14
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}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static onDelete(ORM\Event $event)