UserRenameEvent   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 61
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getId() 0 4 1
A getDate() 0 4 1
A getUser() 0 4 1
A getOldLogin() 0 4 1
1
<?php
2
3
namespace Skobkin\Bundle\PointToolsBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @ORM\Table(name="rename_log", schema="users", indexes={
9
 *     @ORM\Index(name="idx_rename_log_date", columns={"date"}),
10
 *     @ORM\Index(name="idx_rename_log_old_login", columns={"old_login"})
11
 * })
12
 * @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\UserRenameEventRepository", readOnly=true)
13
 */
14
class UserRenameEvent
15
{
16
    /**
17
     * @var integer
18
     *
19
     * @ORM\Column(name="id", type="integer")
20
     * @ORM\Id
21
     * @ORM\GeneratedValue(strategy="AUTO")
22
     */
23
    private $id;
24
25
    /**
26
     * @var User
27
     *
28
     * @ORM\ManyToOne(targetEntity="Skobkin\Bundle\PointToolsBundle\Entity\User")
29
     * @ORM\JoinColumn(name="user_id", nullable=false, onDelete="CASCADE")
30
     */
31
    private $user;
32
33
    /**
34
     * @var \DateTime
35
     *
36
     * @ORM\Column(name="date", type="datetime")
37
     */
38
    private $date;
39
40
    /**
41
     * @var string
42
     *
43
     * @ORM\Column(name="old_login", type="text")
44
     */
45
    private $oldLogin;
46
47
48
    public function __construct(User $user, string $old)
49
    {
50
        $this->user = $user;
51
        $this->oldLogin = $old;
52
        $this->date = new \DateTime();
53
    }
54
55
    public function getId(): int
56
    {
57
        return $this->id;
58
    }
59
60
    public function getDate(): \DateTime
61
    {
62
        return $this->date;
63
    }
64
65
    public function getUser(): User
66
    {
67
        return $this->user;
68
    }
69
70
    public function getOldLogin(): string
71
    {
72
        return $this->oldLogin;
73
    }
74
}
75