AuditJavascript   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 35
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A tableName() 0 4 1
A getEntry() 0 4 1
A attributeLabels() 0 12 1
1
<?php
2
/**
3
 * This model allows for storing of javascript logging entries linked to a specific audit entry
4
 */
5
6
namespace bedezign\yii2\audit\models;
7
8
use bedezign\yii2\audit\components\db\ActiveRecord;
9
use Yii;
10
11
/**
12
 * AuditJavascript
13
 *
14
 * @package bedezign\yii2\audit\models
15
 * @property int    $id
16
 * @property int    $entry_id
17
 * @property string $created
18
 * @property string $type
19
 * @property string $message
20
 * @property string $origin
21
 * @property string $data
22
 *
23
 * @property AuditEntry    $entry
24
 */
25
class AuditJavascript extends ActiveRecord
26
{
27
28
    /**
29
     * @inheritdoc
30
     */
31 27
    public static function tableName()
32
    {
33 27
        return '{{%audit_javascript}}';
34
    }
35
36
    /**
37
     * @return \yii\db\ActiveQuery
38
     */
39 3
    public function getEntry()
40
    {
41 3
        return $this->hasOne(AuditEntry::className(), ['id' => 'entry_id']);
42
    }
43
44
    /**
45
     * @inheritdoc
46
     */
47 12
    public function attributeLabels()
48
    {
49
        return [
50 12
            'id'        => Yii::t('audit', 'ID'),
51 12
            'entry_id'  => Yii::t('audit', 'Entry ID'),
52 12
            'created'   => Yii::t('audit', 'Created'),
53 12
            'type'      => Yii::t('audit', 'Type'),
54 12
            'message'   => Yii::t('audit', 'Message'),
55 12
            'origin'    => Yii::t('audit', 'Origin'),
56 12
            'data'      => Yii::t('audit', 'Data'),
57 12
        ];
58
    }
59
}