Failed Conditions
Push — issue#797 ( 813539 )
by Guilherme
07:02
created

AccountRecoveryData::getPerson()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the login-cidadao project or it's bundles.
4
 *
5
 * (c) Guilherme Donato <guilhermednt on github>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace LoginCidadao\CoreBundle\Entity;
12
13
use Doctrine\ORM\Mapping as ORM;
14
use libphonenumber\PhoneNumber;
15
use LoginCidadao\CoreBundle\Model\PersonInterface;
16
use LoginCidadao\ValidationBundle\Validator\Constraints as LCAssert;
17
use Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber as AssertPhoneNumber;
18
use Symfony\Component\Validator\Constraints as Assert;
19
20
/**
21
 * AccountRecoveryData
22
 *
23
 * @ORM\Table(name="account_recovery_data")
24
 * @ORM\Entity(repositoryClass="LoginCidadao\CoreBundle\Entity\AccountRecoveryDataRepository")
25
 */
26
class AccountRecoveryData
27
{
28
    /**
29
     * @var integer
30
     *
31
     * @ORM\Column(name="id", type="integer")
32
     * @ORM\Id
33
     * @ORM\GeneratedValue(strategy="AUTO")
34
     */
35
    private $id;
36
37
    /**
38
     * @var PersonInterface
39
     *
40
     * @ORM\ManyToOne(targetEntity="Person")
41
     * @ORM\JoinColumn(name="person_id", referencedColumnName="id", nullable=false)
42
     */
43
    private $person;
44
45
    /**
46
     * @var string
47
     *
48
     * @ORM\Column(name="email", type="string", length=255, nullable=true)
49
     * @LCAssert\Email(strict=true)
50
     * @Assert\NotBlank(message="person.validation.email.not_blank")
51
     */
52
    private $email;
53
54
    /**
55
     * @var PhoneNumber
56
     *
57
     * @ORM\Column(name="mobile", type="phone_number", nullable=true)
58
     * @LCAssert\E164PhoneNumber(
59
     *     maxMessage="person.validation.mobile.length.max",
60
     *     groups={"Registration", "LoginCidadaoRegistration", "Dynamic", "Profile", "LoginCidadaoProfile"}
61
     * )
62
     * @LCAssert\MobilePhoneNumber(
63
     *     missing9thDigit="person.validation.mobile.9thDigit",
64
     *     groups={"Registration", "LoginCidadaoRegistration", "Dynamic", "Profile", "LoginCidadaoProfile"}
65
     * )
66
     * @AssertPhoneNumber(
67
     *     type="mobile",
68
     *     groups={"Registration", "LoginCidadaoRegistration", "Dynamic", "Profile", "LoginCidadaoProfile"}
69
     * )
70
     */
71
    private $mobile;
72
73
    /**
74
     * @var \DateTime
75
     *
76
     * @ORM\Column(name="created_at", type="datetime")
77
     */
78
    private $createdAt;
79
80
    /**
81
     * @var \DateTime
82
     *
83
     * @ORM\Column(name="updated_at", type="datetime")
84
     */
85
    private $updatedAt;
86
87
    /**
88
     * Get id
89
     *
90
     * @return integer
91
     */
92
    public function getId()
93
    {
94
        return $this->id;
95
    }
96
97
    /**
98
     * Set person
99
     *
100
     * @param PersonInterface $person
101
     *
102
     * @return AccountRecoveryData
103
     */
104
    public function setPerson(PersonInterface $person): AccountRecoveryData
105
    {
106
        $this->person = $person;
107
108
        return $this;
109
    }
110
111
    /**
112
     * Get person
113
     *
114
     * @return PersonInterface
115
     */
116
    public function getPerson(): PersonInterface
117
    {
118
        return $this->person;
119
    }
120
121
    /**
122
     * Set email
123
     *
124
     * @param string $email
125
     *
126
     * @return AccountRecoveryData
127
     */
128
    public function setEmail(string $email): AccountRecoveryData
129
    {
130
        $this->email = $email;
131
132
        return $this;
133
    }
134
135
    /**
136
     * Get email
137
     *
138
     * @return string
139
     */
140
    public function getEmail(): string
141
    {
142
        return $this->email;
143
    }
144
145
    /**
146
     * Set mobile
147
     *
148
     * @param PhoneNumber $mobile
149
     *
150
     * @return AccountRecoveryData
151
     */
152
    public function setMobile(PhoneNumber $mobile): AccountRecoveryData
153
    {
154
        $this->mobile = $mobile;
155
156
        return $this;
157
    }
158
159
    /**
160
     * Get mobile
161
     *
162
     * @return PhoneNumber
163
     */
164
    public function getMobile(): PhoneNumber
165
    {
166
        return $this->mobile;
167
    }
168
169
    /**
170
     * Set createdAt
171
     *
172
     * @param \DateTime $createdAt
173
     *
174
     * @return AccountRecoveryData
175
     */
176
    public function setCreatedAt($createdAt)
177
    {
178
        $this->createdAt = $createdAt;
179
180
        return $this;
181
    }
182
183
    /**
184
     * Get createdAt
185
     *
186
     * @return \DateTime
187
     */
188
    public function getCreatedAt()
189
    {
190
        return $this->createdAt;
191
    }
192
193
    /**
194
     * Set updatedAt
195
     *
196
     * @param \DateTime $updatedAt
197
     *
198
     * @return AccountRecoveryData
199
     */
200
    public function setUpdatedAt($updatedAt)
201
    {
202
        $this->updatedAt = $updatedAt;
203
204
        return $this;
205
    }
206
207
    /**
208
     * Get updatedAt
209
     *
210
     * @return \DateTime
211
     */
212
    public function getUpdatedAt()
213
    {
214
        return $this->updatedAt;
215
    }
216
}
217