Choice::getChoiceName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Doctrine\Common\Collections\ArrayCollection;
7
8
/**
9
 * Choice.
10
 *
11
 * @ORM\Table(name="choices")
12
 * @ORM\Entity(repositoryClass="AppBundle\Repository\ChoiceRepository")
13
 */
14
class Choice
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="choice_name", type="string", length=255)
29
     */
30
    private $choiceName;
31
32
    /**
33
     * @ORM\OneToMany(targetEntity="Vote", mappedBy="choice")
34
     */
35
    private $votes;
36
37
    /**
38
     * Constructor.
39
     */
40
    public function __construct()
41
    {
42
        $this->votes = new ArrayCollection();
43
    }
44
45
    /**
46
     * Get id.
47
     *
48
     * @return int
49
     */
50
    public function getId(): int
51
    {
52
        return $this->id;
53
    }
54
55
    /**
56
     * Set choiceName.
57
     *
58
     * @param string $choiceName
59
     *
60
     * @return Choice
61
     */
62
    public function setChoiceName(string $choiceName)
63
    {
64
        $this->choiceName = $choiceName;
65
66
        return $this;
67
    }
68
69
    /**
70
     * Get choiceName.
71
     *
72
     * @return string
73
     */
74
    public function getChoiceName(): string
75
    {
76
        return $this->choiceName;
77
    }
78
79
    /**
80
     * Add vote.
81
     *
82
     * @param \AppBundle\Entity\Vote $vote
83
     *
84
     * @return Choice
85
     */
86
    public function addVote(\AppBundle\Entity\Vote $vote)
87
    {
88
        $this->votes[] = $vote;
89
90
        return $this;
91
    }
92
93
    /**
94
     * Remove vote.
95
     *
96
     * @param \AppBundle\Entity\Vote $vote
97
     */
98
    public function removeVote(\AppBundle\Entity\Vote $vote)
99
    {
100
        $this->votes->removeElement($vote);
101
    }
102
103
    /**
104
     * Get votes.
105
     *
106
     * @return \Doctrine\Common\Collections\Collection
107
     */
108
    public function getVotes()
109
    {
110
        return $this->votes;
111
    }
112
}
113