Completed
Pull Request — master (#9)
by Valentyn
04:21
created

UserProfile::getUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
ccs 0
cts 2
cp 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace App\Entity;
5
6
use Doctrine\Common\Collections\ArrayCollection;
7
use Doctrine\ORM\Mapping as ORM;
8
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
9
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
10
use Symfony\Component\Security\Core\User\UserInterface;
11
use JMS\Serializer\Annotation\Exclude;
12
use JMS\Serializer\Annotation\Expose;
13
14
/**
15
 * @ORM\Entity
16
 * @ORM\Table(name="users_profiles")
17
 */
18
class UserProfile
19
{
20
    /**
21
     * @ORM\Id()
22
     * @ORM\GeneratedValue()
23
     * @ORM\Column(type="integer")
24
     */
25
    private $id;
26
27
    /**
28
     * @var $user User
29
     * @ORM\OneToOne(targetEntity="App\Entity\User", inversedBy="profile")
30
     * @ORM\JoinColumn(nullable=false)
31
     */
32
    private $user;
33
34
    /**
35
     * @var $contacts UserProfileContacts[]|ArrayCollection
36
     * @ORM\OneToMany(targetEntity="App\Entity\UserProfileContacts", mappedBy="contacts", cascade={"persist", "remove"})
37
     * @ORM\JoinColumn(nullable=true)
38
     */
39
    private $contacts;
40
41
    /**
42
     * @ORM\Column(type="string", length=255, nullable=true)
43
     */
44
    private $first_name;
45
46
    /**
47
     * @ORM\Column(type="string", length=255, nullable=true)
48
     */
49
    private $last_name;
50
51
    /**
52
     * @ORM\Column(type="date", nullable=true)
53
     */
54
    private $birth_date;
55
56
    /**
57
     * @ORM\Column(type="string", length=255, nullable=true)
58
     */
59
    private $about;
60
61
    /**
62
     * @ORM\Column(type="string", length=255, nullable=true)
63
     */
64
    private $public_email;
65
66 14
    public function __construct()
67
    {
68 14
        $this->contacts = new ArrayCollection();
69 14
    }
70
71
    /**
72
     * @return mixed
73
     */
74
    public function getId()
75
    {
76
        return $this->id;
77
    }
78
79
    /**
80
     * @return User
81
     */
82
    public function getUser(): User
83
    {
84
        return $this->user;
85
    }
86
87
    /**
88
     * @param User $user
89
     * @return UserProfile
90
     */
91 14
    public function setUser(User $user): UserProfile
92
    {
93 14
        $this->user = $user;
94 14
        return $this;
95
    }
96
97
    /**
98
     * @return UserProfileContacts[]|ArrayCollection
99
     */
100
    public function getContacts()
101
    {
102
        return $this->contacts;
103
    }
104
105
    /**
106
     * @return mixed
107
     *
108
     */
109
    public function getFirstName()
110
    {
111
        return $this->first_name;
112
    }
113
114
    /**
115
     * @param mixed $first_name
116
     * @return UserProfile
117
     */
118
    public function setFirstName($first_name)
119
    {
120
        $this->first_name = $first_name;
121
        return $this;
122
    }
123
124
    /**
125
     * @return mixed
126
     */
127
    public function getLastName()
128
    {
129
        return $this->last_name;
130
    }
131
132
    /**
133
     * @param mixed $last_name
134
     * @return UserProfile
135
     */
136
    public function setLastName($last_name)
137
    {
138
        $this->last_name = $last_name;
139
        return $this;
140
    }
141
142
    /**
143
     * @return mixed
144
     */
145
    public function getBirthDate()
146
    {
147
        return $this->birth_date;
148
    }
149
150
    /**
151
     * @param mixed $birth_date
152
     * @return UserProfile
153
     */
154
    public function setBirthDate($birth_date)
155
    {
156
        $this->birth_date = $birth_date;
157
        return $this;
158
    }
159
160
    /**
161
     * @return mixed
162
     */
163
    public function getAbout()
164
    {
165
        return $this->about;
166
    }
167
168
    /**
169
     * @param mixed $about
170
     * @return UserProfile
171
     */
172
    public function setAbout($about)
173
    {
174
        $this->about = $about;
175
        return $this;
176
    }
177
178
    /**
179
     * @return mixed
180
     */
181
    public function getPublicEmail()
182
    {
183
        return $this->public_email;
184
    }
185
186
    /**
187
     * @param mixed $public_email
188
     * @return UserProfile
189
     */
190
    public function setPublicEmail($public_email)
191
    {
192
        $this->public_email = $public_email;
193
        return $this;
194
    }
195
}