Completed
Pull Request — master (#144)
by
unknown
13:04
created

Client   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 120
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 120
rs 10
wmc 8
lcom 0
cbo 3

7 Methods

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