Passed
Push — master ( d38343...31d2e5 )
by Damien
03:47
created

AuditEntry::__isset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace DH\DoctrineAuditBundle\Reader;
4
5
class AuditEntry
6
{
7
    /**
8
     * @var int
9
     */
10
    protected $id;
11
12
    /**
13
     * @var string
14
     */
15
    protected $type;
16
17
    /**
18
     * @var string
19
     */
20
    protected $object_id;
21
22
    /**
23
     * @var null|string
24
     */
25
    protected $transaction_hash;
26
27
    /**
28
     * @var string
29
     */
30
    protected $diffs;
31
32
    /**
33
     * @var null|int|string
34
     */
35
    protected $blame_id;
36
37
    /**
38
     * @var string
39
     */
40
    protected $blame_user;
41
42
    /**
43
     * @var string
44
     */
45
    protected $blame_user_fqdn;
46
47
    /**
48
     * @var string
49
     */
50
    protected $blame_user_firewall;
51
52
    /**
53
     * @var string
54
     */
55
    protected $ip;
56
57
    /**
58
     * @var string
59
     */
60
    protected $created_at;
61
62
    public function __set($name, $value)
63
    {
64
        $this->{$name} = $value;
65
    }
66
67
    public function __get($name)
68
    {
69
        return $this->{$name};
70
    }
71
72
    public function __isset($name)
73
    {
74
        return property_exists($this, $name);
75
    }
76
77
    /**
78
     * Get the value of id.
79
     *
80
     * @return int
81
     */
82
    public function getId(): int
83
    {
84
        return $this->id;
85
    }
86
87
    /**
88
     * Get the value of type.
89
     *
90
     * @return string
91
     */
92
    public function getType(): string
93
    {
94
        return $this->type;
95
    }
96
97
    /**
98
     * Get the value of object_id.
99
     *
100
     * @return string
101
     */
102
    public function getObjectId(): string
103
    {
104
        return $this->object_id;
105
    }
106
107
    /**
108
     * Get the value of transaction_hash.
109
     *
110
     * @return null|string
111
     */
112
    public function getTransactionHash(): ?string
113
    {
114
        return $this->transaction_hash;
115
    }
116
117
    /**
118
     * Get the value of blame_id.
119
     *
120
     * @return null|int|string
121
     */
122
    public function getUserId()
123
    {
124
        return $this->blame_id;
125
    }
126
127
    /**
128
     * Get the value of blame_user.
129
     *
130
     * @return null|string
131
     */
132
    public function getUsername(): ?string
133
    {
134
        return $this->blame_user;
135
    }
136
137
    /**
138
     * @return null|string
139
     */
140
    public function getUserFqdn(): ?string
141
    {
142
        return $this->blame_user_fqdn;
143
    }
144
145
    /**
146
     * @return null|string
147
     */
148
    public function getUserFirewall(): ?string
149
    {
150
        return $this->blame_user_firewall;
151
    }
152
153
    /**
154
     * Get the value of ip.
155
     *
156
     * @return string
157
     */
158
    public function getIp(): ?string
159
    {
160
        return $this->ip;
161
    }
162
163
    /**
164
     * Get the value of created_at.
165
     *
166
     * @return string
167
     */
168
    public function getCreatedAt(): string
169
    {
170
        return $this->created_at;
171
    }
172
173
    /**
174
     * Get the value of created_at.
175
     *
176
     * @return array
177
     */
178
    public function getDiffs(): ?array
179
    {
180
        return json_decode($this->diffs, true);
181
    }
182
}
183