Completed
Push — master ( 9b5005...0cce4e )
by Loïc
14s queued 12s
created

AdminUser   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 1
dl 0
loc 78
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getLastName() 0 4 1
A setLastName() 0 4 1
A getFirstName() 0 4 1
A setFirstName() 0 4 1
A getAvatar() 0 4 1
A setAvatar() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of AppName.
5
 *
6
 * (c) Monofony
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace App\Entity\User;
13
14
use Doctrine\ORM\Mapping as ORM;
15
use Sylius\Component\User\Model\User as BaseUser;
16
17
/**
18
 * @ORM\Entity
19
 * @ORM\Table("sylius_admin_user")
20
 */
21
class AdminUser extends BaseUser implements AdminUserInterface
22
{
23
    /**
24
     * @var string|null
25
     *
26
     * @ORM\Column(type="string", nullable=true)
27
     */
28
    private $lastName;
29
30
    /**
31
     * @var string|null
32
     *
33
     * @ORM\Column(type="string", nullable=true)
34
     */
35
    private $firstName;
36
37
    /**
38
     * @var AdminAvatarInterface|null
39
     *
40
     * @ORM\OneToOne(targetEntity="App\Entity\User\AdminAvatar", cascade={"persist"})
41
     */
42
    private $avatar;
43
44
    public function __construct()
45
    {
46
        parent::__construct();
47
48
        $this->roles = [self::DEFAULT_ADMIN_ROLE];
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function getLastName(): ?string
55
    {
56
        return $this->lastName;
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62
    public function setLastName(?string $lastName): void
63
    {
64
        $this->lastName = $lastName;
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function getFirstName(): ?string
71
    {
72
        return $this->firstName;
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function setFirstName(?string $firstName): void
79
    {
80
        $this->firstName = $firstName;
81
    }
82
83
    /**
84
     * {@inheritdoc}
85
     */
86
    public function getAvatar(): ?AdminAvatarInterface
87
    {
88
        return $this->avatar;
89
    }
90
91
    /**
92
     * {@inheritdoc}
93
     */
94
    public function setAvatar(?AdminAvatarInterface $avatar): void
95
    {
96
        $this->avatar = $avatar;
97
    }
98
}
99