1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AppBundle\Entity; |
4
|
|
|
|
5
|
|
|
use AppBundle\Traits\TimestampableTrait; |
6
|
|
|
use Doctrine\ORM\Mapping as ORM; |
7
|
|
|
use Gedmo\Blameable\Traits\BlameableEntity; |
8
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
9
|
|
|
use Sonata\TranslationBundle\Model\Gedmo\AbstractPersonalTranslatable; |
10
|
|
|
use Sonata\TranslationBundle\Model\TranslatableInterface; |
11
|
|
|
use AppBundle\Traits\DeletedByTrait; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Client. |
15
|
|
|
* |
16
|
|
|
* @ORM\Table() |
17
|
|
|
* @ORM\Entity(repositoryClass="AppBundle\Repository\ClientRepository") |
18
|
|
|
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false) |
19
|
|
|
*/ |
20
|
|
|
class Client |
21
|
|
|
{ |
22
|
|
|
use TimestampableTrait, BlameableEntity, DeletedByTrait; |
23
|
|
|
/** |
24
|
|
|
* @var int |
25
|
|
|
* |
26
|
|
|
* @ORM\Column(name="id", type="integer") |
27
|
|
|
* @ORM\Id |
28
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
29
|
|
|
*/ |
30
|
|
|
private $id; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var string |
34
|
|
|
* |
35
|
|
|
* @ORM\Column(name="ip", type="string", length=20, unique=true) |
36
|
|
|
*/ |
37
|
|
|
private $ip; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var int |
41
|
|
|
* |
42
|
|
|
* @ORM\Column(name="countAttempts", type="integer") |
43
|
|
|
*/ |
44
|
|
|
private $countAttempts; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @var bool |
48
|
|
|
* |
49
|
|
|
* @ORM\Column(name="banned", type="boolean") |
50
|
|
|
*/ |
51
|
|
|
private $banned; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Get id. |
55
|
|
|
* |
56
|
|
|
* @return int |
57
|
|
|
*/ |
58
|
|
|
public function getId() |
59
|
|
|
{ |
60
|
|
|
return $this->id; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Set ip. |
65
|
|
|
* |
66
|
|
|
* @param string $ip |
67
|
|
|
* |
68
|
|
|
* @return Client |
69
|
|
|
*/ |
70
|
|
|
public function setIp($ip) |
71
|
|
|
{ |
72
|
|
|
$this->ip = $ip; |
73
|
|
|
|
74
|
|
|
return $this; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Get ip. |
79
|
|
|
* |
80
|
|
|
* @return string |
81
|
|
|
*/ |
82
|
|
|
public function getIp() |
83
|
|
|
{ |
84
|
|
|
return $this->ip; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Set countAttempts. |
89
|
|
|
* |
90
|
|
|
* @param int $countAttempts |
91
|
|
|
* |
92
|
|
|
* @return Client |
93
|
|
|
*/ |
94
|
|
|
public function setCountAttempts($countAttempts) |
95
|
|
|
{ |
96
|
|
|
$this->countAttempts = $countAttempts; |
97
|
|
|
|
98
|
|
|
return $this; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* Get countAttempts. |
103
|
|
|
* |
104
|
|
|
* @return int |
105
|
|
|
*/ |
106
|
|
|
public function getCountAttempts() |
107
|
|
|
{ |
108
|
|
|
return $this->countAttempts; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* Set ban. |
113
|
|
|
* |
114
|
|
|
* @param bool $banned |
115
|
|
|
* |
116
|
|
|
* @return Client |
117
|
|
|
*/ |
118
|
|
|
public function setBanned($banned) |
119
|
|
|
{ |
120
|
|
|
$this->banned = $banned; |
121
|
|
|
|
122
|
|
|
return $this; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* Get banned. |
127
|
|
|
* |
128
|
|
|
* @return bool |
129
|
|
|
*/ |
130
|
|
|
public function isBanned() |
131
|
|
|
{ |
132
|
|
|
return $this->banned; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
public function __toString() |
136
|
|
|
{ |
137
|
|
|
return $this->getIp(); |
138
|
|
|
} |
139
|
|
|
} |
140
|
|
|
|