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\PhoneVerificationBundle\Entity; |
12
|
|
|
|
13
|
|
|
use Doctrine\ORM\Mapping as ORM; |
14
|
|
|
use libphonenumber\PhoneNumber; |
15
|
|
|
use LoginCidadao\CoreBundle\Model\PersonInterface; |
16
|
|
|
use LoginCidadao\PhoneVerificationBundle\Model\BlockedPhoneNumberInterface; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Class BlockedPhoneNumber |
20
|
|
|
* |
21
|
|
|
* @package LoginCidadao\PhoneVerificationBundle\Model |
22
|
|
|
* |
23
|
|
|
* @ORM\Entity(repositoryClass="LoginCidadao\PhoneVerificationBundle\Entity\BlockedPhoneNumberRepository") |
24
|
|
|
* @ORM\Table(name="blocked_phone_number") |
25
|
|
|
* @ORM\HasLifecycleCallbacks |
26
|
|
|
*/ |
27
|
|
|
class BlockedPhoneNumber implements BlockedPhoneNumberInterface |
28
|
|
|
{ |
29
|
|
|
/** |
30
|
|
|
* @var integer |
31
|
|
|
* |
32
|
|
|
* @ORM\Column(name="id", type="integer") |
33
|
|
|
* @ORM\Id |
34
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
35
|
|
|
*/ |
36
|
|
|
private $id; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var PhoneNumber |
40
|
|
|
* |
41
|
|
|
* @ORM\Column(name="phone_number", type="phone_number", nullable=false) |
42
|
|
|
*/ |
43
|
|
|
private $phoneNumber; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @var PersonInterface |
47
|
|
|
* |
48
|
|
|
* @ORM\ManyToOne(targetEntity="LoginCidadao\CoreBundle\Entity\Person") |
49
|
|
|
* @ORM\JoinColumn(name="blocked_by_person_id", referencedColumnName="id", unique=false) |
50
|
|
|
*/ |
51
|
|
|
private $blockedBy; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @var \DateTime |
55
|
|
|
* |
56
|
|
|
* @ORM\Column(name="created_at", type="datetime", nullable=true) |
57
|
|
|
*/ |
58
|
|
|
private $createdAt; |
59
|
|
|
|
60
|
2 |
|
public function __construct(PhoneNumber $phoneNumber, PersonInterface $blockedBy, \DateTime $createdAt) |
61
|
|
|
{ |
62
|
2 |
|
$this->phoneNumber = $phoneNumber; |
63
|
2 |
|
$this->blockedBy = $blockedBy; |
64
|
2 |
|
$this->createdAt = $createdAt; |
65
|
2 |
|
} |
66
|
|
|
|
67
|
1 |
|
public function getId() |
68
|
|
|
{ |
69
|
1 |
|
return $this->id; |
70
|
|
|
} |
71
|
|
|
|
72
|
2 |
|
public function getPhoneNumber(): PhoneNumber |
73
|
|
|
{ |
74
|
2 |
|
return $this->phoneNumber; |
75
|
|
|
} |
76
|
|
|
|
77
|
2 |
|
public function getBlockedBy(): PersonInterface |
78
|
|
|
{ |
79
|
2 |
|
return $this->blockedBy; |
80
|
|
|
} |
81
|
|
|
|
82
|
2 |
|
public function getCreatedAt(): \DateTime |
83
|
|
|
{ |
84
|
2 |
|
return $this->createdAt; |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|