Completed
Push — master ( b14e26...fac3e1 )
by Guillaume
13:47
created

Utilisateur   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 2
dl 0
loc 63
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getRoles() 0 9 2
A getPassword() 0 4 1
A getSalt() 0 4 1
A getUsername() 0 4 1
A eraseCredentials() 0 3 1
1
<?php
2
3
namespace Starkerxp\UtilisateurBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Starkerxp\StructureBundle\Entity\Entity;
7
use Starkerxp\StructureBundle\Entity\UtilisateurInterface;
8
use Symfony\Component\Security\Core\User\UserInterface;
9
10
/**
11
 * Utilisateur
12
 *
13
 * @ORM\Table(name="utilisateur")
14
 * @ORM\Entity(repositoryClass="Starkerxp\UtilisateurBundle\Repository\UtilisateurRepository")
15
 */
16
class Utilisateur extends Entity implements UtilisateurInterface, UserInterface
17
{
18
19
    /**
20
     * @var RoleUtilisateur
21
     *
22
     * @ORM\OneToOne(targetEntity="RoleUtilisateur", cascade={"persist"})
23
     * @ORM\JoinColumn(name="roles", referencedColumnName="id", nullable=false)
24
     */
25
    protected $roles;
26
27
    /**
28
     * @var string
29
     *
30
     * @ORM\Column(name="salt", type="string", length=255)
31
     */
32
    protected $salt;
33
34
    /**
35
     * @var string
36
     *
37
     * @ORM\Column(name="password", type="string", length=255)
38
     */
39
    protected $password;
40
41
    /**
42
     * @var string
43
     *
44
     * @ORM\Column(name="email", type="string", length=255)
45
     */
46
    protected $email;
47
48
    public function getRoles()
49
    {
50
        /** @var \Starkerxp\UtilisateurBundle\Entity\RoleUtilisateur $roles */
51
        if (empty($this->roles)) {
52
            return null;
53
        }
54
55
        return $this->roles->getRoles();
56
    }
57
58
    public function getPassword()
59
    {
60
        return $this->password;
61
    }
62
63
    public function getSalt()
64
    {
65
        return $this->salt;
66
    }
67
68
    public function getUsername()
69
    {
70
        return $this->email;
71
    }
72
73
    public function eraseCredentials()
74
    {
75
    }
76
77
78
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
79