LogModel   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 6
eloc 29
c 2
b 0
f 1
dl 0
loc 55
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 7 1
A attributeLabels() 0 9 1
A attributes() 0 9 1
A getMacros() 0 3 1
A getTitle() 0 3 1
A getBody() 0 3 1
1
<?php
2
3
namespace micetm\timeline;
4
5
6
use yii\base\Model;
7
8
class LogModel extends Model
9
{
10
11
    public $action;
12
    public $title;
13
    public $body;
14
    public $log_date;
15
    public $macros;
16
    public $_id;
17
18
    public function rules()
19
    {
20
        return [
21
            [['action', 'title'], 'required'],
22
            [['action', 'title', 'body'], 'string'],
23
            ['log_date', 'integer'],
24
            ['macros', 'safe']
25
        ];
26
    }
27
28
    public function attributes()
29
    {
30
        return [
31
            '_id',
32
            'action',
33
            'title',
34
            'body',
35
            'macros',
36
            'log_date',
37
        ];
38
    }
39
40
    public function attributeLabels()
41
    {
42
        return [
43
            '_id' => '#',
44
            'action' => 'Action',
45
            'macros' => 'Macros',
46
            'title' => 'Title',
47
            'body' => 'Body',
48
            'log_date' => 'Date',
49
        ];
50
    }
51
    
52
    public function getMacros()
53
    {
54
        return $this->macros;
55
    }
56
    public function getTitle()
57
    {
58
        return $this->title;
59
    }
60
    public function getBody()
61
    {
62
        return $this->body;
63
    }
64
}
65