1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
userdevicelogintable.php
См. документацию.
1
<?php
8
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
$alias = ($conn instanceof
Main\DB\MysqlCommonConnection
?
'DL'
:
''
);
85
86
$conn->query(
"
87
DELETE {$alias} FROM b_user_device_login DL
88
WHERE DL.DEVICE_ID IN(
89
SELECT ID FROM b_user_device
90
{$where}
91
)"
92
);
93
94
$entity
->cleanCache();
95
}
96
}
Bitrix\Main\ArgumentException
Определения
ArgumentException.php:9
Bitrix\Main\Authentication\Internal\UserDeviceLoginTable
Определения
userdevicelogintable.php:32
Bitrix\Main\Authentication\Internal\UserDeviceLoginTable\getMap
static getMap()
Определения
userdevicelogintable.php:40
Bitrix\Main\Authentication\Internal\UserDeviceLoginTable\deleteByDeviceFilter
static deleteByDeviceFilter($where)
Определения
userdevicelogintable.php:74
Bitrix\Main\Authentication\Internal\UserDeviceLoginTable\getTableName
static getTableName()
Определения
userdevicelogintable.php:35
Bitrix\Main\DB\MysqlCommonConnection
Определения
mysqlcommonconnection.php:10
Bitrix\Main\ORM\Data\DataManager
Определения
datamanager.php:35
Bitrix\Main\ORM\Data\DataManager\getEntity
static getEntity()
Определения
datamanager.php:65
Bitrix\Main\ORM\Data\DataManager\$entity
static $entity
Определения
datamanager.php:47
Bitrix\Main\ORM\Fields\DatetimeField
Определения
datetimefield.php:22
Bitrix\Main\ORM\Fields\IntegerField
Определения
integerfield.php:20
Bitrix\Main\ORM\Fields\StringField
Определения
stringfield.php:20
Bitrix\Main\ORM\Fields\Validators
Определения
booleanvalidator.php:9
Bitrix\Main\ORM\Fields
Определения
arrayfield.php:9
bitrix
modules
main
lib
authentication
internal
userdevicelogintable.php
Создано системой
1.14.0