|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace monsterhunter\yii2\log\models; |
|
4
|
|
|
|
|
5
|
|
|
use monsterhunter\yii2\log\Module; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* This is the models class for table "system_log". |
|
9
|
|
|
* |
|
10
|
|
|
* @property integer $id |
|
11
|
|
|
* @property integer $level |
|
12
|
|
|
* @property string $category |
|
13
|
|
|
* @property integer $log_time |
|
14
|
|
|
* @property string $prefix |
|
15
|
|
|
* @property integer $message |
|
16
|
|
|
*/ |
|
17
|
|
|
class SystemLog extends \yii\db\ActiveRecord |
|
18
|
|
|
{ |
|
19
|
|
|
const CATEGORY_NOTIFICATION = 'notification'; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* @inheritdoc |
|
23
|
|
|
*/ |
|
24
|
7 |
|
public static function tableName() |
|
25
|
|
|
{ |
|
26
|
7 |
|
return '{{%system_log}}'; |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @inheritdoc |
|
31
|
|
|
*/ |
|
32
|
1 |
|
public function rules() |
|
33
|
|
|
{ |
|
34
|
|
|
return [ |
|
35
|
1 |
|
[['level', 'log_time'], 'integer'], |
|
36
|
|
|
[['log_time'], 'required'], |
|
37
|
|
|
[['prefix','message'], 'string'], |
|
38
|
|
|
[['category'], 'string', 'max' => 255] |
|
39
|
|
|
]; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @inheritdoc |
|
44
|
|
|
*/ |
|
45
|
2 |
|
public function attributeLabels() |
|
46
|
|
|
{ |
|
47
|
|
|
return [ |
|
48
|
2 |
|
'id' => Module::t('log', 'ID'), |
|
49
|
2 |
|
'level' => Module::t('log', 'Level'), |
|
50
|
2 |
|
'category' => Module::t('log', 'Category'), |
|
51
|
2 |
|
'log_time' => Module::t('log', 'Log Time'), |
|
52
|
2 |
|
'prefix' => Module::t('log', 'Prefix'), |
|
53
|
2 |
|
'message' => Module::t('log', 'Message'), |
|
54
|
|
|
]; |
|
55
|
|
|
} |
|
56
|
|
|
} |
|
57
|
|
|
|