Log   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 51
ccs 0
cts 35
cp 0
rs 10
c 0
b 0
f 0
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setPrev() 0 4 1
A setFunction() 0 4 1
A setIp() 0 4 1
A setSession() 0 4 1
A getPrev() 0 2 1
A setNext() 0 4 1
A getNext() 0 2 1
A setName() 0 4 1
A onLoad() 0 5 1
1
<?php
2
3
namespace MocOrm\Support;
4
5
/**
6
 * Implementation.
7
 */
8
class Log extends Model
9
{
10
    public function onLoad() {
11
        $this->setTableName('tb_log')
12
            ->setPrimaryKey()
13
            ->setIp()
14
            ->setSession();
15
    }
16
17
    public function setPrev($prev) {
18
        $this->prev = json_encode($prev);
0 ignored issues
show
Bug Best Practice introduced by
The property prev does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
19
20
        return $this;
21
    }
22
23
    public function getPrev() {
24
        return json_decode($this->prev);
25
    }
26
27
    public function setNext($next) {
28
        $this->next = json_encode($next);
0 ignored issues
show
Bug Best Practice introduced by
The property next does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
29
30
        return $this;
31
    }
32
33
    public function getNext() {
34
        return json_decode($this->next);
35
    }
36
37
    public function setFunction($name) {
38
        $this->function = $name;
0 ignored issues
show
Bug Best Practice introduced by
The property function does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
39
40
        return $this;
41
    }
42
43
    public function setSession() {
44
        $this->session = json_encode(@$_SESSION);
0 ignored issues
show
Bug Best Practice introduced by
The property session does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
45
46
        return $this;
47
    }
48
49
    public function setName($name) {
50
        $this->name = $name;
0 ignored issues
show
Bug Best Practice introduced by
The property name does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
51
52
        return $this;
53
    }
54
55
    public function setIp() {
56
        $this->ip = @$_SERVER['REMOTE_ADDR'];
0 ignored issues
show
Bug Best Practice introduced by
The property ip does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
57
58
        return $this;
59
    }
60
61
62
}
63