SystemLog   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 40
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A tableName() 0 4 1
A rules() 0 9 1
A attributeLabels() 0 11 1
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