Completed
Branch master (6321d1)
by Gawain
10:09 queued 03:32
created

Authtoken::setIp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace Bolt\Storage\Entity;
3
4
/**
5
 * Entity for Auth Tokens.
6
 */
7
class Authtoken extends Entity
8
{
9
    /** @var int */
10
    protected $id;
11
    /** @var string */
12
    protected $username;
13
    /** @var string */
14
    protected $token;
15
    /** @var string */
16
    protected $salt;
17
    /** @var \DateTime */
18
    protected $lastseen;
19
    /** @var string */
20
    protected $ip;
21
    /** @var string */
22
    protected $useragent;
23
    /** @var \DateTime */
24
    protected $validity;
25
26
    /**
27
     * @return int
28
     */
29
    public function getId()
30
    {
31
        return $this->id;
32
    }
33
34
    /**
35
     * @param int $id
36
     */
37
    public function setId($id)
38
    {
39
        $this->id = $id;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getUsername()
46
    {
47
        return $this->username;
48
    }
49
50
    /**
51
     * @param string $username
52
     */
53
    public function setUsername($username)
54
    {
55
        $this->username = $username;
56
    }
57
58
    /**
59
     * @return string
60
     */
61
    public function getToken()
62
    {
63
        return $this->token;
64
    }
65
66
    /**
67
     * @param string $token
68
     */
69
    public function setToken($token)
70
    {
71
        $this->token = $token;
72
    }
73
74
    /**
75
     * @return string
76
     */
77
    public function getSalt()
78
    {
79
        return $this->salt;
80
    }
81
82
    /**
83
     * @param string $salt
84
     */
85
    public function setSalt($salt)
86
    {
87
        $this->salt = $salt;
88
    }
89
90
    /**
91
     * @return \DateTime
92
     */
93
    public function getLastseen()
94
    {
95
        return $this->lastseen;
96
    }
97
98
    /**
99
     * @param \DateTime $lastseen
100
     */
101
    public function setLastseen($lastseen)
102
    {
103
        $this->lastseen = $lastseen;
104
    }
105
106
    /**
107
     * @return string
108
     */
109
    public function getIp()
110
    {
111
        return $this->ip;
112
    }
113
114
    /**
115
     * @param string $ip
116
     */
117
    public function setIp($ip)
118
    {
119
        $this->ip = $ip;
120
    }
121
122
    /**
123
     * @return string
124
     */
125
    public function getUseragent()
126
    {
127
        return $this->useragent;
128
    }
129
130
    /**
131
     * Setter for the user agent string.
132
     *
133
     * @param string $useragent
134
     */
135
    public function setUseragent($useragent)
136
    {
137
        $this->useragent = substr($useragent, 0, 128);
138
    }
139
140
    /**
141
     * @return \DateTime
142
     */
143
    public function getValidity()
144
    {
145
        return $this->validity;
146
    }
147
148
    /**
149
     * @param \DateTime $validity
150
     */
151
    public function setValidity($validity)
152
    {
153
        $this->validity = $validity;
154
    }
155
}
156