Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
userauthaction.php
1
<?php
8
namespace
Bitrix\Main
;
9
10
use
Bitrix\Main\Entity
;
11
use
Bitrix\Main\ORM\Data
;
12
29
class
UserAuthActionTable
extends
Entity\DataManager
30
{
31
use Data\Internal\DeleteByFilterTrait;
32
33
const
PRIORITY_HIGH
= 100;
34
const
PRIORITY_LOW
= 200;
35
36
const
ACTION_LOGOUT
=
'logout'
;
37
const
ACTION_UPDATE
=
'update'
;
38
39
public
static
function
getTableName
()
40
{
41
return
'b_user_auth_action'
;
42
}
43
44
public
static
function
getMap
()
45
{
46
return
array(
47
'ID'
=> array(
48
'data_type'
=>
'integer'
,
49
'primary'
=>
true
,
50
'autocomplete'
=>
true
,
51
),
52
'USER_ID'
=> array(
53
'data_type'
=>
'integer'
54
),
55
'PRIORITY'
=> array(
56
'data_type'
=>
'integer'
57
),
58
'ACTION'
=> array(
59
'data_type'
=>
'string'
60
),
61
'ACTION_DATE'
=> array(
62
'data_type'
=>
'datetime'
63
),
64
'APPLICATION_ID'
=> array(
65
'data_type'
=>
'string'
66
),
67
);
68
}
69
76
public
static
function
addLogoutAction
($userId, $applicationId =
null
)
77
{
78
return
static::add(array(
79
'USER_ID'
=> $userId,
80
'PRIORITY'
=> self::PRIORITY_HIGH,
81
'ACTION'
=> self::ACTION_LOGOUT,
82
'ACTION_DATE'
=>
new
Type
\
DateTime
(),
83
'APPLICATION_ID'
=> $applicationId,
84
));
85
}
86
92
public
static
function
addUpdateAction
($userId,
Type
\
DateTime
$date =
null
)
93
{
94
if
($date ===
null
)
95
{
96
$date =
new
Type\DateTime
();
97
}
98
99
return
static::add(array(
100
'USER_ID'
=> $userId,
101
'PRIORITY'
=> self::PRIORITY_LOW,
102
'ACTION'
=> self::ACTION_UPDATE,
103
'ACTION_DATE'
=> $date,
104
));
105
}
106
}
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Main\UserAuthActionTable
Definition
userauthaction.php:30
Bitrix\Main\UserAuthActionTable\getMap
static getMap()
Definition
userauthaction.php:44
Bitrix\Main\UserAuthActionTable\PRIORITY_HIGH
const PRIORITY_HIGH
Definition
userauthaction.php:33
Bitrix\Main\UserAuthActionTable\PRIORITY_LOW
const PRIORITY_LOW
Definition
userauthaction.php:34
Bitrix\Main\UserAuthActionTable\addUpdateAction
static addUpdateAction($userId, Type\DateTime $date=null)
Definition
userauthaction.php:92
Bitrix\Main\UserAuthActionTable\ACTION_UPDATE
const ACTION_UPDATE
Definition
userauthaction.php:37
Bitrix\Main\UserAuthActionTable\addLogoutAction
static addLogoutAction($userId, $applicationId=null)
Definition
userauthaction.php:76
Bitrix\Main\UserAuthActionTable\ACTION_LOGOUT
const ACTION_LOGOUT
Definition
userauthaction.php:36
Bitrix\Main\UserAuthActionTable\getTableName
static getTableName()
Definition
userauthaction.php:39
Bitrix\Main\ORM\Data
Definition
addresult.php:9
Bitrix\Main\Type
Definition
collection.php:2
Bitrix\Main
modules
main
lib
userauthaction.php
Создано системой
1.10.0