Passed
Push — master ( a6dc76...6d79cb )
by Guilherme
01:12 queued 11s
created

BlockedPhoneNumber   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 58
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getPhoneNumber() 0 3 1
A getCreatedAt() 0 3 1
A getBlockedBy() 0 3 1
A getId() 0 3 1
A __construct() 0 5 1
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", indexes={
25
 *     @ORM\Index(name="blocked_phone_number_idx", columns={"phone_number"})
26
 * })
27
 * @ORM\HasLifecycleCallbacks
28
 */
29
class BlockedPhoneNumber implements BlockedPhoneNumberInterface
30
{
31
    /**
32
     * @var integer
33
     *
34
     * @ORM\Column(name="id", type="integer")
35
     * @ORM\Id
36
     * @ORM\GeneratedValue(strategy="AUTO")
37
     */
38
    private $id;
39
40
    /**
41
     * @var PhoneNumber
42
     *
43
     * @ORM\Column(name="phone_number", type="phone_number", nullable=false, unique=true)
44
     */
45
    private $phoneNumber;
46
47
    /**
48
     * @var PersonInterface
49
     *
50
     * @ORM\ManyToOne(targetEntity="LoginCidadao\CoreBundle\Entity\Person")
51
     * @ORM\JoinColumn(name="blocked_by_person_id", referencedColumnName="id", unique=false)
52
     */
53
    private $blockedBy;
54
55
    /**
56
     * @var \DateTime
57
     *
58
     * @ORM\Column(name="created_at", type="datetime", nullable=true)
59
     */
60
    private $createdAt;
61
62 2
    public function __construct(PhoneNumber $phoneNumber, PersonInterface $blockedBy, \DateTime $createdAt)
63
    {
64 2
        $this->phoneNumber = $phoneNumber;
65 2
        $this->blockedBy = $blockedBy;
66 2
        $this->createdAt = $createdAt;
67 2
    }
68
69 1
    public function getId()
70
    {
71 1
        return $this->id;
72
    }
73
74 2
    public function getPhoneNumber(): PhoneNumber
75
    {
76 2
        return $this->phoneNumber;
77
    }
78
79 2
    public function getBlockedBy(): PersonInterface
80
    {
81 2
        return $this->blockedBy;
82
    }
83
84 2
    public function getCreatedAt(): \DateTime
85
    {
86 2
        return $this->createdAt;
87
    }
88
}
89