Member   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Test Coverage

Coverage 78.26%

Importance

Changes 0
Metric Value
dl 0
loc 75
ccs 18
cts 23
cp 0.7826
rs 10
c 0
b 0
f 0
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setCommunity() 0 5 1
A prePersist() 0 3 1
A setIsLead() 0 5 1
A setJoinedAt() 0 5 1
A getCommunity() 0 3 1
A getUser() 0 3 1
A getIsLead() 0 3 1
A setUser() 0 5 1
A getJoinedAt() 0 3 1
1
<?php
2
3
namespace App\Entity\Community;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
use App\Entity\User\User;
8
9
/**
10
 * @ORM\Entity()
11
 * @ORM\Table(name="communities__member")
12
 * @ORM\HasLifecycleCallbacks
13
 */
14
class Member
15
{
16
    /**
17
     * @ORM\Id
18
     * @ORM\ManyToOne(targetEntity="App\Entity\Community\Community")
19
     */
20
    protected $community;
21
    /**
22
     * @ORM\Id
23
     * @ORM\ManyToOne(targetEntity="App\Entity\User\User")
24
     */
25
    protected $user;
26
    /**
27
     * @ORM\Column(type="boolean")
28
     */
29
    protected $isLead;
30
    /**
31
     * @ORM\Column(type="datetime")
32
     */
33
    protected $joinedAt;
34
    
35
    /**
36
     * @ORM\PrePersist()
37
     */
38 1
    public function prePersist()
39
    {
40 1
        $this->joinedAt = new \DateTime();
41 1
    }
42
    
43 5
    public function setCommunity(Community $community): Member
44
    {
45 5
        $this->community = $community;
46
        
47 5
        return $this;
48
    }
49
    
50 2
    public function getCommunity(): Community
51
    {
52 2
        return $this->community;
53
    }
54
    
55 5
    public function setUser(User $user): Member
56
    {
57 5
        $this->user = $user;
58
        
59 5
        return $this;
60
    }
61
    
62 2
    public function getUser(): User
63
    {
64 2
        return $this->user;
65
    }
66
    
67 3
    public function setIsLead(bool $isLead): Member
68
    {
69 3
        $this->isLead = $isLead;
70
        
71 3
        return $this;
72
    }
73
    
74 2
    public function getIsLead(): bool
75
    {
76 2
        return $this->isLead;
77
    }
78
    
79
    public function setJoinedAt(\DateTime $joinedAt): Member
80
    {
81
        $this->joinedAt = $joinedAt;
82
        
83
        return $this;
84
    }
85
    
86
    public function getJoinedAt(): \DateTime
87
    {
88
        return $this->joinedAt;
89
    }
90
}