SystemLog::attributeLabels()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
ccs 7
cts 7
cp 1
crap 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