Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
userdevicelogintable.php
1
<?php
9
namespace
Bitrix\Main\Authentication\Internal
;
10
11
use
Bitrix\Main
;
12
use
Bitrix\Main\ORM\Data
;
13
use
Bitrix\Main\ORM\Fields
;
14
31
class
UserDeviceLoginTable
extends
Data\DataManager
32
{
33
use Data\Internal\DeleteByFilterTrait;
34
35
public
static
function
getTableName
()
36
{
37
return
'b_user_device_login'
;
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(
'DEVICE_ID'
))
48
->addValidator(
new
Fields\Validators\ForeignValidator(
UserDeviceTable::getEntity
()->getField(
'ID'
))),
49
50
(
new
Fields\
DatetimeField
(
'LOGIN_DATE'
)),
51
52
(
new
Fields\
StringField
(
'IP'
)),
53
54
(
new
Fields\
IntegerField
(
'CITY_GEOID'
))
55
->configureNullable(),
56
57
(
new
Fields\IntegerField(
'REGION_GEOID'
))
58
->configureNullable(),
59
60
(
new
Fields\StringField(
'COUNTRY_ISO_CODE'
))
61
->configureNullable(),
62
63
(
new
Fields\IntegerField(
'APP_PASSWORD_ID'
))
64
->configureNullable(),
65
66
(
new
Fields\IntegerField(
'STORED_AUTH_ID'
))
67
->configureNullable(),
68
69
(
new
Fields\IntegerField(
'HIT_AUTH_ID'
))
70
->configureNullable(),
71
];
72
}
73
74
public
static
function
deleteByDeviceFilter
($where)
75
{
76
if
($where ==
''
)
77
{
78
throw
new
Main\ArgumentException
(
"Deleting by empty filter is not allowed, use truncate (b_user_device_login)."
,
"where"
);
79
}
80
81
$entity
= static::getEntity();
82
$conn =
$entity
->getConnection();
83
84
$conn->query(
"
85
DELETE DL FROM b_user_device_login DL
86
WHERE DL.DEVICE_ID IN(
87
SELECT ID FROM b_user_device
88
{$where}
89
)"
90
);
91
92
$entity
->cleanCache();
93
}
94
}
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Main\Authentication\Internal\UserDeviceLoginTable
Definition
userdevicelogintable.php:32
Bitrix\Main\Authentication\Internal\UserDeviceLoginTable\getMap
static getMap()
Definition
userdevicelogintable.php:40
Bitrix\Main\Authentication\Internal\UserDeviceLoginTable\deleteByDeviceFilter
static deleteByDeviceFilter($where)
Definition
userdevicelogintable.php:74
Bitrix\Main\Authentication\Internal\UserDeviceLoginTable\getTableName
static getTableName()
Definition
userdevicelogintable.php:35
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Data\DataManager\getEntity
static getEntity()
Definition
datamanager.php:78
Bitrix\Main\ORM\Data\DataManager\$entity
static $entity
Definition
datamanager.php:45
Bitrix\Main\ORM\Fields\DatetimeField
Definition
datetimefield.php:22
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\Authentication\Internal
Definition
groupsubordinatetable.php:10
Bitrix\Main\ORM\Data
Definition
addresult.php:9
Bitrix\Main\ORM\Fields
Definition
arrayfield.php:9
Bitrix\Main
modules
main
lib
authentication
internal
userdevicelogintable.php
Создано системой
1.10.0