Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
log.php
1
<?
2
namespace
Bitrix\Main\Composite\Debug\Model
;
3
4
use
Bitrix\Main
;
5
use
Bitrix\Main\Application
;
6
use
Bitrix\Main\Composite\Debug\Logger
;
7
use
Bitrix\Main\Localization\Loc
;
8
use
Bitrix\Main\Type\DateTime
;
9
10
Loc::loadMessages
(__FILE__);
11
43
class
LogTable
extends
Main\Entity\DataManager
44
{
50
public
static
function
getTableName
()
51
{
52
return
"b_composite_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
"title"
=>
"ID"
68
),
69
"HOST"
=> array(
70
"data_type"
=>
"string"
,
71
"required"
=>
true
,
72
"validation"
=> array(__CLASS__,
"validateHost"
),
73
"title"
=>
Loc::getMessage
(
"LOG_ENTITY_HOST_FIELD"
)
74
),
75
"URI"
=> array(
76
"data_type"
=>
"string"
,
77
"required"
=>
true
,
78
"validation"
=> array(__CLASS__,
"validateUri"
),
79
"title"
=>
Loc::getMessage
(
"LOG_ENTITY_URI_FIELD"
)
80
),
81
"TITLE"
=> array(
82
"data_type"
=>
"string"
,
83
"validation"
=> array(__CLASS__,
"validateTitle"
),
84
"title"
=>
Loc::getMessage
(
"LOG_ENTITY_TITLE_FIELD"
)
85
),
86
"CREATED"
=> array(
87
"data_type"
=>
"datetime"
,
88
"required"
=>
true
,
89
"default_value"
=>
new
DateTime
(),
90
"title"
=>
Loc::getMessage
(
"LOG_ENTITY_CREATED_FIELD"
),
91
),
92
"TYPE"
=> array(
93
"data_type"
=>
"enum"
,
94
"required"
=>
true
,
95
"values"
=>
Logger::getTypes
(),
96
"default_value"
=>
Logger::TYPE_MESSAGE
,
97
"title"
=>
Loc::getMessage
(
"LOG_ENTITY_TYPE_FIELD"
),
98
),
99
"MESSAGE"
=> array(
100
"data_type"
=>
"text"
,
101
"title"
=>
Loc::getMessage
(
"LOG_ENTITY_MESSAGE_FIELD"
),
102
),
103
"MESSAGE_SHORT"
=> array(
104
"data_type"
=>
"text"
,
105
"expression"
=> array(
106
"case when %s = '"
.
Logger::TYPE_CACHE_REWRITING
.
"' then NULL else %s end"
,
107
"TYPE"
,
"MESSAGE"
108
),
109
"title"
=>
Loc::getMessage
(
"LOG_ENTITY_MESSAGE_FIELD"
),
110
),
111
112
"AJAX"
=> array(
113
"data_type"
=>
"boolean"
,
114
"values"
=> array(
"N"
,
"Y"
),
115
"title"
=>
Loc::getMessage
(
"LOG_ENTITY_AJAX_FIELD"
),
116
),
117
"USER_ID"
=> array(
118
"data_type"
=>
"integer"
,
119
"required"
=>
true
,
120
"default_value"
=> 0,
121
"title"
=>
Loc::getMessage
(
"LOG_ENTITY_USER_ID_FIELD"
),
122
),
123
124
"USER"
=> array(
125
"data_type"
=>
"\\Bitrix\\Main\\UserTable"
,
126
"reference"
=> array(
127
"=this.USER_ID"
=>
"ref.ID"
128
),
129
"join_type"
=>
"LEFT"
,
130
),
131
132
"PAGE_ID"
=> array(
133
"data_type"
=>
"integer"
,
134
"required"
=>
true
,
135
"default_value"
=> 0,
136
"title"
=>
Loc::getMessage
(
"LOG_ENTITY_PAGE_ID_FIELD"
),
137
),
138
);
139
}
145
public
static
function
validateHost
()
146
{
147
return
array(
148
new
Main\
Entity
\Validator\Length(
null
, 100),
149
);
150
}
151
157
public
static
function
validateUri
()
158
{
159
return
array(
160
new
Main\
Entity
\Validator\Length(
null
, 2000),
161
);
162
}
163
169
public
static
function
validateTitle
()
170
{
171
return
array(
172
new
Main\
Entity
\Validator\Length(
null
, 250),
173
);
174
}
175
179
public
static
function
deleteAll
()
180
{
181
$tableName = static::getTableName();
182
$connection =
Application::getConnection
();
183
$connection->queryExecute(
"DELETE FROM {$tableName}"
);
184
}
185
}
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Application\getConnection
static getConnection($name="")
Definition
application.php:611
Bitrix\Main\Composite\Debug\Logger
Definition
logger.php:11
Bitrix\Main\Composite\Debug\Logger\TYPE_MESSAGE
const TYPE_MESSAGE
Definition
logger.php:37
Bitrix\Main\Composite\Debug\Logger\getTypes
static getTypes()
Definition
logger.php:114
Bitrix\Main\Composite\Debug\Logger\TYPE_CACHE_REWRITING
const TYPE_CACHE_REWRITING
Definition
logger.php:12
Bitrix\Main\Composite\Debug\Model\LogTable
Definition
log.php:44
Bitrix\Main\Composite\Debug\Model\LogTable\getMap
static getMap()
Definition
log.php:60
Bitrix\Main\Composite\Debug\Model\LogTable\validateUri
static validateUri()
Definition
log.php:157
Bitrix\Main\Composite\Debug\Model\LogTable\validateHost
static validateHost()
Definition
log.php:145
Bitrix\Main\Composite\Debug\Model\LogTable\validateTitle
static validateTitle()
Definition
log.php:169
Bitrix\Main\Composite\Debug\Model\LogTable\deleteAll
static deleteAll()
Definition
log.php:179
Bitrix\Main\Composite\Debug\Model\LogTable\getTableName
static getTableName()
Definition
log.php:50
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Main\Composite\Debug\Model
Definition
log.php:2
Bitrix\Main
modules
main
lib
composite
debug
model
log.php
Создано системой
1.10.0