PollType   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 115
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 1
dl 0
loc 115
ccs 0
cts 18
cp 0
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 1
A setName() 0 6 1
A getName() 0 4 1
A addPoll() 0 6 1
A removePoll() 0 4 1
A getPolls() 0 4 1
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Doctrine\Common\Collections\ArrayCollection;
7
8
/**
9
 * PollType.
10
 *
11
 * @ORM\Table(name="poll_type")
12
 * @ORM\Entity(repositoryClass="AppBundle\Repository\PollTypeRepository")
13
 */
14
class PollType
15
{
16
    /**
17
     * @var int
18
     *
19
     * @ORM\Column(name="id", type="integer")
20
     * @ORM\Id
21
     * @ORM\GeneratedValue(strategy="AUTO")
22
     */
23
    private $id;
24
25
    /**
26
     * @var string
27
     *
28
     * @ORM\Column(name="name", type="string", length=255, unique=true)
29
     */
30
    private $name;
31
32
    /**
33
     * @ORM\OneToMany(targetEntity="Poll", mappedBy="pollType")
34
     */
35
    private $polls;
36
37
    /**
38
     * @var float
39
     *
40
     * @ORM\Column(name="quorum", type="float")
41
     */
42
    private $quorum;
43
44
    private $electorateGroup;
45
46
    /**
47
     * @var float
48
     *
49
     * @ORM\Column(name="majority", type="float")
50
     */
51
    private $majority;
52
53
    /**
54
     * Constructor.
55
     */
56
    public function __construct()
57
    {
58
        $this->polls = new ArrayCollection();
59
    }
60
61
    /**
62
     * Get id.
63
     *
64
     * @return int
65
     */
66
    public function getId(): int
67
    {
68
        return $this->id;
69
    }
70
71
    /**
72
     * Set name.
73
     *
74
     * @param string $name
75
     *
76
     * @return PollType
77
     */
78
    public function setName(string $name)
79
    {
80
        $this->name = $name;
81
82
        return $this;
83
    }
84
85
    /**
86
     * Get name.
87
     *
88
     * @return string
89
     */
90
    public function getName(): string
91
    {
92
        return $this->name;
93
    }
94
95
    /**
96
     * Add poll.
97
     *
98
     * @param \AppBundle\Entity\Poll $poll
99
     *
100
     * @return PollType
101
     */
102
    public function addPoll(\AppBundle\Entity\Poll $poll)
103
    {
104
        $this->polls[] = $poll;
105
106
        return $this;
107
    }
108
109
    /**
110
     * Remove poll.
111
     *
112
     * @param \AppBundle\Entity\Poll $poll
113
     */
114
    public function removePoll(\AppBundle\Entity\Poll $poll)
115
    {
116
        $this->polls->removeElement($poll);
117
    }
118
119
    /**
120
     * Get polls.
121
     *
122
     * @return \Doctrine\Common\Collections\Collection
123
     */
124
    public function getPolls()
125
    {
126
        return $this->polls;
127
    }
128
}
129