1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
applog.php
См. документацию.
1<?php
2namespace Bitrix\Rest;
3
4use Bitrix\Main;
5
34
35class 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}
static getMap()
Определения applog.php:60
const ACTION_TYPE_UNINSTALL
Определения applog.php:40
const USER_ADMIN
Определения applog.php:42
const USER_NOT_ADMIN
Определения applog.php:43
const ACTION_TYPE_UPDATE
Определения applog.php:39
const ACTION_TYPE_ADD
Определения applog.php:37
static log($appId, $action)
Определения applog.php:90
const ACTION_TYPE_INSTALL
Определения applog.php:38
static getTableName()
Определения applog.php:50
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
global $USER
Определения csv_new_run.php:40
$action
Определения file_dialog.php:21
$fields
Определения yandex_run.php:501