Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
userdevicetable.php
1<?php
10
11use Bitrix\Main;
14
32{
33 use Data\Internal\DeleteByFilterTrait;
34
35 public static function getTableName()
36 {
37 return 'b_user_device';
38 }
39
40 public static function getMap()
41 {
42 return [
43 (new Fields\IntegerField('ID'))
44 ->configurePrimary(true)
45 ->configureAutocomplete(true),
46
47 (new Fields\IntegerField('USER_ID'))
48 ->addValidator(new Fields\Validators\ForeignValidator(Main\UserTable::getEntity()->getField('ID'))),
49
50 (new Fields\StringField('DEVICE_UID')),
51
52 (new Fields\IntegerField('DEVICE_TYPE')),
53
54 (new Fields\StringField('BROWSER')),
55
56 (new Fields\StringField('PLATFORM')),
57
58 (new Fields\TextField('USER_AGENT')),
59
60 (new Fields\BooleanField('COOKABLE'))
61 ->configureValues('N', 'Y')
62 ->configureDefaultValue('N'),
63 ];
64 }
65
66 public static function onDelete(\Bitrix\Main\ORM\Event $event)
67 {
68 $id = $event->getParameter('id');
69
70 UserDeviceLoginTable::deleteByFilter(['=DEVICE_ID' => $id]);
71 }
72
73 protected static function onBeforeDeleteByFilter(string $where)
74 {
76 }
77}
static onDelete(\Bitrix\Main\ORM\Event $event)