AccountToken::setAccount()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace PiouPiou\RibsAdminBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * Entity\AccountToken
9
 *
10
 * @ORM\Entity(repositoryClass="PiouPiou\RibsAdminBundle\Repository\AccountTokenRepository")
11
 * @ORM\Table(name="`account_token`",
12
 *     indexes = {
13
 *          @ORM\Index(name="fk_user_token_account_idx", columns={"account_id"})
14
 *     }, uniqueConstraints={@ORM\UniqueConstraint(name="guid_UNIQUE_account_token", columns={"guid"})})
15
 * @ORM\EntityListeners({"PiouPiou\RibsAdminBundle\EventListener\GuidAwareListener"})
16
 */
17
class AccountToken
18
{
19
    use GuidTrait;
20
21
    /**
22
     * @ORM\Id
23
     * @ORM\Column(type="integer")
24
     * @ORM\GeneratedValue(strategy="AUTO")
25
     */
26
    protected $id;
27
28
    /**
29
     * @ORM\Column(type="string", length=200)
30
     */
31
    protected $token;
32
33
    /**
34
     * @ORM\Column(type="datetime", nullable=true)
35
     */
36
    protected $endToken;
37
38
    /**
39
     * @ORM\Column(type="string", length=200)
40
     */
41
    protected $userAgent;
42
43
    /**
44
     * @ORM\Column(type="string", length=200)
45
     */
46
    protected $ip;
47
48
    /**
49
     * @ORM\ManyToOne(targetEntity="Account", inversedBy="tokens")
50
     * @ORM\JoinColumn(name="account_id", referencedColumnName="id", nullable=false)
51
     */
52
    protected $account;
53
54
    /**
55
     * @return mixed
56
     */
57
    public function getId()
58
    {
59
        return $this->id;
60
    }
61
62
    /**
63
     * @param mixed $id
64
     * @return AccountToken
65
     */
66
    public function setId($id)
67
    {
68
        $this->id = $id;
69
70
        return $this;
71
    }
72
73
    /**
74
     * @return mixed
75
     */
76
    public function getToken()
77
    {
78
        return $this->token;
79
    }
80
81
    /**
82
     * @param mixed $token
83
     * @return AccountToken
84
     */
85
    public function setToken($token)
86
    {
87
        $this->token = $token;
88
89
        return $this;
90
    }
91
92
    /**
93
     * @return mixed
94
     */
95
    public function getEndToken()
96
    {
97
        return $this->endToken;
98
    }
99
100
    /**
101
     * @param mixed $endToken
102
     * @return AccountToken
103
     */
104
    public function setEndToken($endToken)
105
    {
106
        $this->endToken = $endToken;
107
108
        return $this;
109
    }
110
111
    /**
112
     * @return mixed
113
     */
114
    public function getUserAgent()
115
    {
116
        return $this->userAgent;
117
    }
118
119
    /**
120
     * @param mixed $userAgent
121
     * @return AccountToken
122
     */
123
    public function setUserAgent($userAgent)
124
    {
125
        $this->userAgent = $userAgent;
126
127
        return $this;
128
    }
129
130
    /**
131
     * @return mixed
132
     */
133
    public function getIp()
134
    {
135
        return $this->ip;
136
    }
137
138
    /**
139
     * @param mixed $ip
140
     * @return AccountToken
141
     */
142
    public function setIp($ip)
143
    {
144
        $this->ip = $ip;
145
146
        return $this;
147
    }
148
149
    /**
150
     * Set Account entity (many to one).
151
     *
152
     * @param Account $account
153
     * @return AccountToken
154
     */
155
    public function setAccount(Account $account = null)
156
    {
157
        $this->account = $account;
158
159
        return $this;
160
    }
161
162
    /**
163
     * Get Account entity (many to one).
164
     *
165
     * @return Account
166
     */
167
    public function getAccount()
168
    {
169
        return $this->account;
170
    }
171
}
172