Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
applog.php
1
<?php
2
namespace
Bitrix\Rest
;
3
4
use
Bitrix\Main
;
5
35
class
AppLogTable
extends
Main\Entity\DataManager
36
{
37
const
ACTION_TYPE_ADD
=
'ADD'
;
38
const
ACTION_TYPE_INSTALL
=
'INSTALL'
;
39
const
ACTION_TYPE_UPDATE
=
'UPDATE'
;
40
const
ACTION_TYPE_UNINSTALL
=
'UNINSTALL'
;
41
42
const
USER_ADMIN
=
'Y'
;
43
const
USER_NOT_ADMIN
=
'N'
;
44
50
public
static
function
getTableName
()
51
{
52
return
'b_rest_app_log'
;
53
}
54
60
public
static
function
getMap
()
61
{
62
return
array(
63
'ID'
=> array(
64
'data_type'
=>
'integer'
,
65
'primary'
=>
true
,
66
'autocomplete'
=>
true
,
67
),
68
'TIMESTAMP_X'
=> array(
69
'data_type'
=>
'datetime'
,
70
),
71
'APP_ID'
=> array(
72
'data_type'
=>
'integer'
,
73
'required'
=>
true
,
74
),
75
'ACTION_TYPE'
=> array(
76
'data_type'
=>
'string'
,
77
'required'
=>
true
,
78
),
79
'USER_ID'
=> array(
80
'data_type'
=>
'integer'
,
81
'required'
=>
true
,
82
),
83
'USER_ADMIN'
=> array(
84
'data_type'
=>
'boolean'
,
85
'values'
=> array(static::USER_NOT_ADMIN, static::USER_ADMIN),
86
),
87
);
88
}
89
90
public
static
function
log
($appId, $action)
91
{
92
global $USER;
93
94
$fields = array(
95
'APP_ID'
=> $appId,
96
'ACTION_TYPE'
=> $action,
97
'USER_ID'
=> $USER->getId(),
98
);
99
100
if
($USER->IsAuthorized())
101
{
102
$fields[
'USER_ADMIN'
] = \CRestUtil::isAdmin() ? static::USER_ADMIN : static::USER_NOT_ADMIN;
103
}
104
else
105
{
106
$fields[
'USER_ADMIN'
] = static::USER_NOT_ADMIN;
107
}
108
109
return
static::add($fields);
110
}
111
}
Bitrix\Rest\AppLogTable
Definition
applog.php:36
Bitrix\Rest\AppLogTable\getMap
static getMap()
Definition
applog.php:60
Bitrix\Rest\AppLogTable\ACTION_TYPE_UNINSTALL
const ACTION_TYPE_UNINSTALL
Definition
applog.php:40
Bitrix\Rest\AppLogTable\USER_ADMIN
const USER_ADMIN
Definition
applog.php:42
Bitrix\Rest\AppLogTable\USER_NOT_ADMIN
const USER_NOT_ADMIN
Definition
applog.php:43
Bitrix\Rest\AppLogTable\ACTION_TYPE_UPDATE
const ACTION_TYPE_UPDATE
Definition
applog.php:39
Bitrix\Rest\AppLogTable\ACTION_TYPE_ADD
const ACTION_TYPE_ADD
Definition
applog.php:37
Bitrix\Rest\AppLogTable\log
static log($appId, $action)
Definition
applog.php:90
Bitrix\Rest\AppLogTable\ACTION_TYPE_INSTALL
const ACTION_TYPE_INSTALL
Definition
applog.php:38
Bitrix\Rest\AppLogTable\getTableName
static getTableName()
Definition
applog.php:50
Bitrix\Main
Bitrix\Rest
Definition
accessexception.php:2
modules
rest
lib
applog.php
Создано системой
1.10.0